Source-Changes-HG archive

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

[src/trunk]: src/sys/kern don't KASSERT(kpreempt_disabled()) while cold



details:   https://anonhg.NetBSD.org/src/rev/a80b0f18d8a5
branches:  trunk
changeset: 372324:a80b0f18d8a5
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Nov 15 10:29:56 2022 +0000

description:
don't KASSERT(kpreempt_disabled()) while cold
pserialize_read_*() can be called *very* early in kernel startup these days

diffstat:

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

diffs (32 lines):

diff -r 6bab73a59ac9 -r a80b0f18d8a5 sys/kern/subr_pserialize.c
--- a/sys/kern/subr_pserialize.c        Tue Nov 15 09:13:43 2022 +0000
+++ b/sys/kern/subr_pserialize.c        Tue Nov 15 10:29:56 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pserialize.c,v 1.18 2021/10/10 11:20:46 riastradh Exp $   */
+/*     $NetBSD: subr_pserialize.c,v 1.19 2022/11/15 10:29:56 macallan Exp $    */
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -31,11 +31,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.18 2021/10/10 11:20:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.19 2022/11/15 10:29:56 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
 #include <sys/cpu.h>
+#include <sys/kernel.h>
 #include <sys/evcnt.h>
 #include <sys/kmem.h>
 #include <sys/mutex.h>
@@ -135,7 +136,7 @@
 pserialize_read_exit(int s)
 {
 
-       KASSERT(kpreempt_disabled());
+       KASSERT((cold || kpreempt_disabled()));
 
        __insn_barrier();
        if (__predict_false(curcpu()->ci_psz_read_depth-- == 0))



Home | Main Index | Thread Index | Old Index