From 2a5e34995f23fac07e4ab695f61449ae23b677a0 Mon Sep 17 00:00:00 2001 From: mvs Date: Wed, 15 Feb 2023 20:43:41 +0000 Subject: [PATCH] Relax kernel lock assertion within tsleep(9). The `nowake' channel is 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index e2c6f2247ac..fd97013cb26 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -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 -- 2.20.1