From c8167830f97e68ba65ea04b9c8835bc4f00bb6ec Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 14 Jul 2009 22:50:41 +0000 Subject: [PATCH] When wakeup(9) is going to notify swapper, assert that wait channel is not equal to &proc0. It shall be not, since proc0 stack is not swappable, and kick_proc0() is wakeup(&proc0). Reviewed by: jhb Approved by: re (kensmith) --- sys/kern/kern_synch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index b91c1a50bc2..aad12b602a4 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -347,8 +347,11 @@ wakeup(void *ident) sleepq_lock(ident); wakeup_swapper = sleepq_broadcast(ident, SLEEPQ_SLEEP, 0, 0); sleepq_release(ident); - if (wakeup_swapper) + if (wakeup_swapper) { + KASSERT(ident != &proc0, + ("wakeup and wakeup_swapper and proc0")); kick_proc0(); + } } /*