OpenBSD cvs log

created 2023-08-07T20:52:42Z
begin 2023-08-05T00:00:00Z
end 2023-08-06T00:00:00Z
path src/sys
commits 6

date 2023-08-05T00:34:19Z
author aoyama
files src/sys/arch/luna88k/dev/lunafb.c log diff annotate
message Inform 8bpp capability on 8bpp framebuffer in
WSDISPLAYIO_GETSUPPORTEDDEPTH ioctl.

This is needed to use recent updated wsfb(4) driver in 8bpp mode.
We can use 1bpp X server on 8bpp framebuffer by 'startx -- -depth 1'.

Tested by me.

date 2023-08-05T05:45:52Z
author guenther
files src/sys/arch/riscv64/include/cpu.h log diff annotate
src/sys/arch/riscv64/riscv64/machdep.c log diff annotate
message cpu_idle_{enter,leave} are no-ops on riscv64, so just #define
away the calls

ok jca@

date 2023-08-05T05:46:36Z
author guenther
files src/sys/arch/mips64/include/cpu.h log diff annotate
src/sys/arch/mips64/mips64/context.S log diff annotate
message cpu_idle_{enter,leave} are no-ops on mips64, so just #define
away the calls

ok jca@

date 2023-08-05T12:41:04Z
author claudio
files src/sys/kern/kern_sched.c log diff annotate
message Remove the P_WSLEEP specific KASSERT(). Not only procs in state SSTOP
can be added to the run queue but also procs in state SRUN. The latter
happens when schedcpu() kicks in before the proc had a chance to run.
Problem spotted by gkoehler@
OK cheloha@

date 2023-08-05T20:07:55Z
author cheloha
files src/sys/kern/kern_clock.c log diff annotate
src/sys/kern/kern_clockintr.c log diff annotate
src/sys/kern/kern_sched.c log diff annotate
src/sys/kern/kern_time.c log diff annotate
src/sys/kern/sched_bsd.c log diff annotate
message hardclock(9): move setitimer(2) code into itimer_update()

- Move the setitimer(2) code responsible for updating the ITIMER_VIRTUAL
and ITIMER_PROF timers from hardclock(9) into a new clock interrupt
routine, itimer_update(). itimer_update() is periodic and runs at the
same frequency as the hardclock.

+ Revise itimerdecr() to run within itimer_mtx instead of entering
and leaving it.

- Each schedstate_percpu has its own itimer_update() handle, spc_itimer.
A new scheduler flag, SPCF_ITIMER, indicates whether spc_itimer was
started during the last mi_switch() and needs to be stopped during the
next mi_switch() or sched_exit().

- A new per-process flag, PS_ITIMER, indicates whether ITIMER_VIRTUAL
and/or ITIMER_PROF are running. Checking the flag is easier than
entering itimer_mtx to check process.ps_timer[]. The flag is set
and cleared in a new helper function, process_reset_itimer_flag().

- In setitimer(), call need_resched() when the state of ITIMER_VIRTUAL
or ITIMER_PROF is changed to force an mi_switch() and update
spc_itimer.

claudio@ notes that ITIMER_PROF could be implemented as a high-res
timer using the thread's execution time as a guide for when to
interrupt the process and assert SIGPROF. This would probably work
really well in single-threaded processes. ITIMER_VIRTUAL would be
more difficult to make high-res, though, as you need to exclude time
spent in the kernel.

Tested on powerpc64 by gkoehler@. With input from claudio@.

Thread: https://marc.info/?l=openbsd-tech&m=169038818517101&w=2

ok claudio@

date 2023-08-05T20:07:56Z
author cheloha
files src/sys/sys/proc.h log diff annotate
src/sys/sys/sched.h log diff annotate
src/sys/sys/systm.h log diff annotate
src/sys/sys/time.h log diff annotate
message hardclock(9): move setitimer(2) code into itimer_update()

- Move the setitimer(2) code responsible for updating the ITIMER_VIRTUAL
and ITIMER_PROF timers from hardclock(9) into a new clock interrupt
routine, itimer_update(). itimer_update() is periodic and runs at the
same frequency as the hardclock.

+ Revise itimerdecr() to run within itimer_mtx instead of entering
and leaving it.

- Each schedstate_percpu has its own itimer_update() handle, spc_itimer.
A new scheduler flag, SPCF_ITIMER, indicates whether spc_itimer was
started during the last mi_switch() and needs to be stopped during the
next mi_switch() or sched_exit().

- A new per-process flag, PS_ITIMER, indicates whether ITIMER_VIRTUAL
and/or ITIMER_PROF are running. Checking the flag is easier than
entering itimer_mtx to check process.ps_timer[]. The flag is set
and cleared in a new helper function, process_reset_itimer_flag().

- In setitimer(), call need_resched() when the state of ITIMER_VIRTUAL
or ITIMER_PROF is changed to force an mi_switch() and update
spc_itimer.

claudio@ notes that ITIMER_PROF could be implemented as a high-res
timer using the thread's execution time as a guide for when to
interrupt the process and assert SIGPROF. This would probably work
really well in single-threaded processes. ITIMER_VIRTUAL would be
more difficult to make high-res, though, as you need to exclude time
spent in the kernel.

Tested on powerpc64 by gkoehler@. With input from claudio@.

Thread: https://marc.info/?l=openbsd-tech&m=169038818517101&w=2

ok claudio@