Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jul 2009 22:50:41 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195700 - head/sys/kern
Message-ID:  <200907142250.n6EMofBo073560@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Jul 14 22:50:41 2009
New Revision: 195700
URL: http://svn.freebsd.org/changeset/base/195700

Log:
  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)

Modified:
  head/sys/kern/kern_synch.c

Modified: head/sys/kern/kern_synch.c
==============================================================================
--- head/sys/kern/kern_synch.c	Tue Jul 14 22:48:30 2009	(r195699)
+++ head/sys/kern/kern_synch.c	Tue Jul 14 22:50:41 2009	(r195700)
@@ -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();
+	}
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907142250.n6EMofBo073560>