Module Name:    src
Committed By:   skrll
Date:           Sat Apr 11 15:23:56 UTC 2015

Modified Files:
        src/sys/kern: kern_lock.c

Log Message:
Allow sleeping in the idle lwp if the cpu isn't running yet.

OK'ed by rmind a while ago.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/kern/kern_lock.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/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.155 src/sys/kern/kern_lock.c:1.156
--- src/sys/kern/kern_lock.c:1.155	Sat Sep 14 20:24:22 2013
+++ src/sys/kern/kern_lock.c	Sat Apr 11 15:23:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.155 2013/09/14 20:24:22 martin Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.156 2015/04/11 15:23:56 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.155 2013/09/14 20:24:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.156 2015/04/11 15:23:56 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -78,7 +78,8 @@ assert_sleepable(void)
 	} while (pctr != lwp_pctr());
 
 	reason = NULL;
-	if (idle && !cold) {
+	if (idle && !cold &&
+	    kcpuset_isset(kcpuset_running, cpu_index(curcpu()))) {
 		reason = "idle";
 	}
 	if (cpu_intr_p()) {

Reply via email to