OpenBSD cvs log

created 2023-07-16T05:06:28Z
begin 2023-07-11T00:00:00Z
end 2023-07-12T00:00:00Z
path src/sys
commits 1

date 2023-07-11T07:02:43Z
author claudio
files src/sys/kern/kern_sched.c log diff annotate
src/sys/kern/kern_sig.c log diff annotate
src/sys/kern/kern_synch.c log diff annotate
src/sys/kern/sched_bsd.c log diff annotate
src/sys/sys/proc.h log diff annotate
message Rework sleep_setup()/sleep_finish() to no longer hold the scheduler lock
between calls.

Instead of forcing an atomic operation across multiple calls use a three
step transaction.
1. setup sleep state by calling sleep_setup()
2. recheck sleep condition to ensure that the event did not fire before
sleep_setup() registered the proc onto the sleep queue
3. call sleep_finish() to either sleep or keep on running based on the
step 2 outcome and any possible signal delivery

To make this work wakeup from signals, single thread api and wakeup(9) need
to be aware if a process is between step 1 and step 3 so that the process
is not enqueued back onto the runqueue while going to sleep. Introduce
the p_flag P_WSLEEP to detect this situation.

On top of this remove the spl dance in msleep() which is no longer required.
It is ok to process interrupts between step 1 and 3.

OK mpi@ cheloha@