From: mpi Date: Thu, 9 Sep 2021 18:23:31 +0000 (+0000) Subject: Move a check to avoid panicing on contended rwlock(9) outside of DIAGNOSTIC. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4666bcdec8985ab906c32a0152fe20c2b5a9a7eb;p=openbsd Move a check to avoid panicing on contended rwlock(9) outside of DIAGNOSTIC. ok kettenis@ --- diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index b476a6b4253..3b403117ed3 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.177 2021/03/04 09:02:37 mpi Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.178 2021/09/09 18:23:31 mpi Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -556,7 +556,6 @@ wakeup_n(const volatile void *ident, int n) qp = &slpque[LOOKUP(ident)]; for (p = TAILQ_FIRST(qp); p != NULL && n != 0; p = pnext) { pnext = TAILQ_NEXT(p, p_runq); -#ifdef DIAGNOSTIC /* * If the rwlock passed to rwsleep() is contended, the * CPU will end up calling wakeup() between sleep_setup() @@ -566,6 +565,7 @@ wakeup_n(const volatile void *ident, int n) KASSERT(p->p_stat == SONPROC); continue; } +#ifdef DIAGNOSTIC if (p->p_stat != SSLEEP && p->p_stat != SSTOP) panic("wakeup: p_stat is %d", (int)p->p_stat); #endif