Module: xenomai-jki Branch: for-upstream Commit: c6ea59bc3882ab346ba5d25b3a3ea07a886241d1 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=c6ea59bc3882ab346ba5d25b3a3ea07a886241d1
Author: Jan Kiszka <[email protected]> Date: Thu Nov 4 16:34:21 2010 +0100 Revert "nucleus/sched: prevent remote wakeup from triggering a debug assertion" This reverts commit 56ff4329ffa5e779034697d6c6e095f137087b44. It assumes xnsched::status is always manipulated atomically, which is not true, breaking remote rescheduling. Signed-off-by: Jan Kiszka <[email protected]> --- include/nucleus/sched.h | 6 ++---- ksrc/nucleus/pod.c | 6 +++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/nucleus/sched.h b/include/nucleus/sched.h index df56417..bb08918 100644 --- a/include/nucleus/sched.h +++ b/include/nucleus/sched.h @@ -177,17 +177,15 @@ static inline int xnsched_self_resched_p(struct xnsched *sched) /* Set self resched flag for the given scheduler. */ #define xnsched_set_self_resched(__sched__) do { \ + xnarch_cpu_set(xnsched_cpu(__sched__), (__sched__)->resched); \ setbits((__sched__)->status, XNRESCHED); \ } while (0) /* Set specific resched flag into the local scheduler mask. */ #define xnsched_set_resched(__sched__) do { \ xnsched_t *current_sched = xnpod_current_sched(); \ + xnarch_cpu_set(xnsched_cpu(__sched__), current_sched->resched); \ setbits(current_sched->status, XNRESCHED); \ - if (current_sched != (__sched__)) { \ - xnarch_cpu_set(xnsched_cpu(__sched__), current_sched->resched); \ - setbits((__sched__)->status, XNRESCHED); \ - } \ } while (0) void xnsched_zombie_hooks(struct xnthread *thread); diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index 14c7534..c04765d 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -288,6 +288,7 @@ void xnpod_schedule_handler(void) /* Called with hw interrupts off. */ #else (void)sched; #endif /* CONFIG_SMP && CONFIG_XENO_OPT_PRIOCPL */ + xnsched_set_self_resched(sched); xnpod_schedule(); } @@ -2171,7 +2172,10 @@ static inline void xnpod_switch_to(xnsched_t *sched, static inline int __xnpod_test_resched(struct xnsched *sched) { - int resched = testbits(sched->status, XNRESCHED); + int cpu = xnsched_cpu(sched), resched; + + resched = xnarch_cpu_isset(cpu, sched->resched); + xnarch_cpu_clear(cpu, sched->resched); #ifdef CONFIG_SMP /* Send resched IPI to remote CPU(s). */ if (unlikely(xnsched_resched_p(sched))) { _______________________________________________ Xenomai-git mailing list [email protected] https://mail.gna.org/listinfo/xenomai-git
