Relax kernel lock assertion within tsleep(9). The `nowake' channel is
authormvs <mvs@openbsd.org>
Wed, 15 Feb 2023 20:43:41 +0000 (20:43 +0000)
committermvs <mvs@openbsd.org>
Wed, 15 Feb 2023 20:43:41 +0000 (20:43 +0000)
the special case which doesn't expect wakeup(9), so allow to use it
without kernel lock held.

Discussed with and ok by claudio@

sys/kern/kern_synch.c

index e2c6f22..fd97013 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_synch.c,v 1.190 2022/08/14 01:58:27 jsg Exp $    */
+/*     $OpenBSD: kern_synch.c,v 1.191 2023/02/15 20:43:41 mvs Exp $    */
 /*     $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
 
 /*
@@ -124,7 +124,7 @@ tsleep(const volatile void *ident, int priority, const char *wmesg, int timo)
        KASSERT(ident != &nowake || ISSET(priority, PCATCH) || timo != 0);
 
 #ifdef MULTIPROCESSOR
-       KASSERT(timo || _kernel_lock_held());
+       KASSERT(ident == &nowake || timo || _kernel_lock_held());
 #endif
 
 #ifdef DDB