summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-08-06 08:44:55 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-08-06 08:44:55 +0000
commitb0be597016d19c50ca454147735a79cd2fed10ff (patch)
tree45fa5dc0a81bb2d8408f930a184062bac704846e /sys/kern/kern_sig.c
parent2be6b01e44184b82710bf1d175004ad8018f558d (diff)
Stop using KERNEL_LOCK to protect the per process kqueue list
Instead of the KERNEL_LOCK use the ps_mtx for most operations. If the ps_klist is modified an additional global rwlock (kqueue_ps_list_lock) is required. This includes the knotes with NOTE_FORK and NOTE_EXIT since in either cases a ps_klist is changed. In the NOTE_FORK | NOTE_TRACK case the call to kqueue_register() can sleep this is why a global rwlock is used. Adjust the reaper() to call knote_processexit() without KERNEL_LOCK. Double lock idea from visa@ OK mvs@
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 2eafc58109e..211675a6749 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.336 2024/07/29 12:42:53 claudio Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.337 2024/08/06 08:44:54 claudio Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -985,7 +985,7 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
}
if (type != SPROPAGATED)
- knote_locked(&pr->ps_klist, NOTE_SIGNAL | signum);
+ knote(&pr->ps_klist, NOTE_SIGNAL | signum);
prop = sigprop[signum];