Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Revert the 2015 change I made that allowed sleeping...



details:   https://anonhg.NetBSD.org/src/rev/f4b2e7a70d99
branches:  trunk
changeset: 990628:f4b2e7a70d99
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Oct 31 16:26:26 2021 +0000

description:
Revert the 2015 change I made that allowed sleeping in the idle lwp
if it wasn't running yet, e.g. in cpu_hatch
---
 sys/kern/kern_lock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 40557427de86..c0c9d8adaf9e 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -89,8 +89,7 @@ assert_sleepable(void)
        } while (pctr != lwp_pctr());

        reason = NULL;
-       if (idle && !cold &&
-           kcpuset_isset(kcpuset_running, cpu_index(curcpu()))) {
+       if (idle && !cold) {
                reason = "idle";
        }
        if (cpu_intr_p()) {
--
2.25.1

diffstat:

 sys/kern/kern_lock.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r b4933e5cd6cf -r f4b2e7a70d99 sys/kern/kern_lock.c
--- a/sys/kern/kern_lock.c      Sun Oct 31 16:24:47 2021 +0000
+++ b/sys/kern/kern_lock.c      Sun Oct 31 16:26:26 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_lock.c,v 1.172 2020/12/22 01:57:29 ad Exp $       */
+/*     $NetBSD: kern_lock.c,v 1.173 2021/10/31 16:26:26 skrll Exp $    */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.172 2020/12/22 01:57:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.173 2021/10/31 16:26:26 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lockdebug.h"
@@ -89,8 +89,7 @@
        } while (pctr != lwp_pctr());
 
        reason = NULL;
-       if (idle && !cold &&
-           kcpuset_isset(kcpuset_running, cpu_index(curcpu()))) {
+       if (idle && !cold) {
                reason = "idle";
        }
        if (cpu_intr_p()) {



Home | Main Index | Thread Index | Old Index