CVSROOT: /cvs Module name: src Changes by: clau...@cvs.openbsd.org 2025/03/10 03:28:57
Modified files: sys/dev/pci/drm: drm_linux.c sys/dev/dt : dt_prov_static.c sys/kern : kern_exit.c kern_fork.c kern_proc.c kern_sched.c kern_sig.c kern_synch.c sched_bsd.c sys/sys : proc.h signalvar.h Log 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@