Module Name:    src
Committed By:   pooka
Date:           Tue Jan 11 10:49:20 UTC 2011

Modified Files:
        src/sys/rump/librump/rumpkern: scheduler.c

Log Message:
KASSERT we don't return back to userspace with the kernel lock held.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/librump/rumpkern/scheduler.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpkern/scheduler.c
diff -u src/sys/rump/librump/rumpkern/scheduler.c:1.23 src/sys/rump/librump/rumpkern/scheduler.c:1.24
--- src/sys/rump/librump/rumpkern/scheduler.c:1.23	Wed Dec  1 20:29:56 2010
+++ src/sys/rump/librump/rumpkern/scheduler.c	Tue Jan 11 10:49:20 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: scheduler.c,v 1.23 2010/12/01 20:29:56 pooka Exp $	*/
+/*      $NetBSD: scheduler.c,v 1.24 2011/01/11 10:49:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.23 2010/12/01 20:29:56 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.24 2011/01/11 10:49:20 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -349,9 +349,14 @@
 void
 rump_unschedule()
 {
-	struct lwp *l;
+	struct lwp *l = rumpuser_get_curlwp();
+#ifdef DIAGNOSTIC
+	int nlock;
+
+	KERNEL_UNLOCK_ALL(l, &nlock);
+	KASSERT(nlock == 0);
+#endif
 
-	l = rumpuser_get_curlwp();
 	KASSERT(l->l_mutex == l->l_cpu->ci_schedstate.spc_mutex);
 	rump_unschedule_cpu(l);
 	l->l_mutex = NULL;

Reply via email to