OpenBSD cvs log

created 2025-03-15T20:43:05Z
begin 2025-03-10T00:00:00Z
end 2025-03-11T00:00:00Z
path src/sys
commits 7

date 2025-03-10T07:38:12Z
author kirill
files src/sys/dev/usb/uvideo.c log diff annotate
message sys/uvideo: fix crash by videoclose() or ioctl(VIDIOC_STREAMOFF) on detached webcam

OK: mglocker@

date 2025-03-10T09:28:56Z
author claudio
files src/sys/dev/dt/dt_prov_static.c log diff annotate
src/sys/dev/pci/drm/drm_linux.c log diff annotate
src/sys/kern/kern_exit.c log diff annotate
src/sys/kern/kern_fork.c log diff annotate
src/sys/kern/kern_proc.c log diff annotate
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
message Rework how processes are stopped because of a signal

The current way is flawed in many ways. The signals are sent to each thread,
the first thread which is stopped signals wait4(2) and the softintr bases
proc_stop_sweep causes additional problems. In the end stopping multithreaded
processes did not work reliably.

Change all of this by reimplementing proc_stop as a transaction similar to
the sleep API and by using some of the single thread API machinery also for
stop signals. This way wait4(2) is only signaled by the last thread going
to sleep. Also ptsignal is no longer sending the signal to all threads
instead the signal is sent to one thread and that one tells all other
threads to stop (via process_stop). Also rewrite the debugger trap code
to use the process stop API instead of abusing the single thread API.
This way a wait4(2) no longer needs to wait for all threads to stop.

Now multithreaded processes can be reliably stopped and continued. This
should fix problems seen in golang, mpv and in our regress tests.

Tested by various people
I think this is ok kettenis@

date 2025-03-10T09:28:57Z
author claudio
files src/sys/sys/proc.h log diff annotate
src/sys/sys/signalvar.h log diff annotate
message Rework how processes are stopped because of a signal

The current way is flawed in many ways. The signals are sent to each thread,
the first thread which is stopped signals wait4(2) and the softintr bases
proc_stop_sweep causes additional problems. In the end stopping multithreaded
processes did not work reliably.

Change all of this by reimplementing proc_stop as a transaction similar to
the sleep API and by using some of the single thread API machinery also for
stop signals. This way wait4(2) is only signaled by the last thread going
to sleep. Also ptsignal is no longer sending the signal to all threads
instead the signal is sent to one thread and that one tells all other
threads to stop (via process_stop). Also rewrite the debugger trap code
to use the process stop API instead of abusing the single thread API.
This way a wait4(2) no longer needs to wait for all threads to stop.

Now multithreaded processes can be reliably stopped and continued. This
should fix problems seen in golang, mpv and in our regress tests.

Tested by various people
I think this is ok kettenis@

date 2025-03-10T14:13:58Z
author mpi
files src/sys/uvm/uvm_anon.c log diff annotate
src/sys/uvm/uvm_aobj.c log diff annotate
src/sys/uvm/uvm_fault.c log diff annotate
src/sys/uvm/uvm_km.c log diff annotate
src/sys/uvm/uvm_object.c log diff annotate
src/sys/uvm/uvm_page.c log diff annotate
src/sys/uvm/uvm_pager.c log diff annotate
src/sys/uvm/uvm_pdaemon.c log diff annotate
src/sys/uvm/uvm_swap.c log diff annotate
src/sys/uvm/uvm_vnode.c log diff annotate
src/sys/uvm/uvmexp.h log diff annotate
message Push uvm_pageqlock dance inside uvm_pagefree().

Reduces the conention on the global lock, mainly in the reaper. The lock
is necessary to guarantee the integrity of the global LRUs.

Tested by many as part of a larger diff, ok kettenis@

date 2025-03-10T15:11:46Z
author mvs
files src/sys/kern/uipc_socket2.c log diff annotate
src/sys/netinet/tcp_input.c log diff annotate
src/sys/netinet/tcp_usrreq.c log diff annotate
src/sys/sys/socketvar.h log diff annotate
message Get rid of unused `so' argument in sbappendstream(). No functional
changes.

ok bluhm

date 2025-03-10T18:54:38Z
author mpi
files src/sys/uvm/uvm_page.h log diff annotate
src/sys/uvm/uvm_pdaemon.c log diff annotate
message Use an iterator to scan the inactive list.

Simplifies the logic to get the next page in the list which requires holding
the pageqlock.

Tested by many in a larger diff, ok claudio@

date 2025-03-10T19:52:57Z
author miod
files src/sys/uvm/uvmexp.h log diff annotate
message Sync description of uvmexp.pdrevs with reality, that comment has been wrong
since the CSRG days.
ok tb@ millert@ jca@ kettenis@