CVSROOT:        /cvs
Module name:    src
Changes by:     m...@cvs.openbsd.org    2021/10/07 02:51:00

Modified files:
        sys/kern       : kern_synch.c 

Log message:
Remove the assertion that `curproc' must be SONPROC if found on the sleepqueue.

If `curproc' finds itself on the sleepqueue inside wakeup(9) it is obviously
being executed.  Such wakeup(9) currently happens inside the critical section
of the SCHED_LOCK(), generally before cpu_switchto().  However `p_stat' is
changed many operations before cpu_switchto() and the KASSERT() isn't helpful
at catching real bugs.

One example of this is a call to rwsleep() that calls wakeup() via rw_exit()
before sleep_finish(), contented futex(2) triggers that a lot.

Another example are dt(4)'s scheduler TRACEPOINT() in setrunqueue() and
mi_switch().

Suggested by and ok kettenis@

Reply via email to