On 24.11.19 16:46, Philippe Gerum via Xenomai wrote:
From: Philippe Gerum <[email protected]>
stop_debugged_thread() may suspend threads running on a remote CPU, we
have to kick the rescheduling procedure for these changes to take
effect asap. Make sure xnsched_run() is kicked from the call sites
once they are done updating the scheduler state.
Signed-off-by: Philippe Gerum <[email protected]>
---
kernel/cobalt/posix/process.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c
index b90e53507..1e003108e 100644
--- a/kernel/cobalt/posix/process.c
+++ b/kernel/cobalt/posix/process.c
@@ -819,6 +819,7 @@ static inline int handle_exception(struct ipipe_trap_data
*d)
}
stop_debugged_process(thread);
xnlock_put_irqrestore(&nklock, s);
+ xnsched_run();
To reduce the potential (but unavoidable) delay between the exception
and the remote thread stops, shouldn't this move under the lock? For the
wakeup, we do this below.
Jan
}
#endif
@@ -1295,10 +1296,8 @@ static int handle_sigwake_event(struct task_struct *p)
cobalt_register_debugged_thread(thread);
}
- if (xnthread_test_state(thread, XNRELAX)) {
- xnlock_put_irqrestore(&nklock, s);
- return KEVENT_PROPAGATE;
- }
+ if (xnthread_test_state(thread, XNRELAX))
+ goto out;
/*
* If kicking a shadow thread in primary mode, make sure Linux
@@ -1320,7 +1319,7 @@ static int handle_sigwake_event(struct task_struct *p)
xnthread_resume(thread, XNDBGSTOP);
__xnthread_kick(thread);
-
+out:
xnsched_run();
xnlock_put_irqrestore(&nklock, s);
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux