Module Name: src Committed By: kamil Date: Fri Jun 21 01:03:51 UTC 2019
Modified Files: src/sys/kern: kern_sig.c src/sys/sys: proc.h Log Message: Eliminate PS_NOTIFYSTOP remnants from the kernel This flag used to be useful in /proc (BSD4.4-style) debugging semantics. Traced child events were notified without signaling the parent. This property was removed in NetBSD-8.0 and had no users. This change simplifies the signal code, removing dead branches. NFCI To generate a diff of this commit: cvs rdiff -u -r1.361 -r1.362 src/sys/kern/kern_sig.c cvs rdiff -u -r1.353 -r1.354 src/sys/sys/proc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_sig.c diff -u src/sys/kern/kern_sig.c:1.361 src/sys/kern/kern_sig.c:1.362 --- src/sys/kern/kern_sig.c:1.361 Tue Jun 18 23:53:55 2019 +++ src/sys/kern/kern_sig.c Fri Jun 21 01:03:51 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig.c,v 1.361 2019/06/18 23:53:55 kamil Exp $ */ +/* $NetBSD: kern_sig.c,v 1.362 2019/06/21 01:03:51 kamil Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.361 2019/06/18 23:53:55 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.362 2019/06/21 01:03:51 kamil Exp $"); #include "opt_ptrace.h" #include "opt_dtrace.h" @@ -1534,7 +1534,7 @@ proc_stop_lwps(struct proc *p) /* * Finish stopping of a process. Mark it stopped and notify the parent. * - * Drop p_lock briefly if PS_NOTIFYSTOP is set and ppsig is true. + * Drop p_lock briefly if ppsig is true. */ static void proc_stop_done(struct proc *p, int ppmask) @@ -1549,11 +1549,10 @@ proc_stop_done(struct proc *p, int ppmas p->p_stat = SSTOP; p->p_waited = 0; p->p_pptr->p_nstopchild++; - if ((p->p_sflag & PS_NOTIFYSTOP) != 0) { - /* child_psignal drops p_lock briefly. */ - child_psignal(p, ppmask); - cv_broadcast(&p->p_pptr->p_waitcv); - } + + /* child_psignal drops p_lock briefly. */ + child_psignal(p, ppmask); + cv_broadcast(&p->p_pptr->p_waitcv); } /* @@ -2251,7 +2250,7 @@ proc_stop(struct proc *p, int signo) * LWPs to a halt so they are included in p->p_nrlwps. We musn't * unlock between here and the p->p_nrlwps check below. */ - p->p_sflag |= PS_STOPPING | PS_NOTIFYSTOP; + p->p_sflag |= PS_STOPPING; membar_producer(); proc_stop_lwps(p); @@ -2325,16 +2324,13 @@ proc_stop_callout(void *cookie) * We brought the process to a halt. * Mark it as stopped and notify the * parent. + * + * Note that proc_stop_done() will + * drop p->p_lock briefly. + * Arrange to restart and check + * all processes again. */ - if ((p->p_sflag & PS_NOTIFYSTOP) != 0) { - /* - * Note that proc_stop_done() will - * drop p->p_lock briefly. - * Arrange to restart and check - * all processes again. - */ - restart = true; - } + restart = true; proc_stop_done(p, PS_NOCLDSTOP); } else more = true; Index: src/sys/sys/proc.h diff -u src/sys/sys/proc.h:1.353 src/sys/sys/proc.h:1.354 --- src/sys/sys/proc.h:1.353 Tue Jun 11 23:18:55 2019 +++ src/sys/sys/proc.h Fri Jun 21 01:03:51 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: proc.h,v 1.353 2019/06/11 23:18:55 kamil Exp $ */ +/* $NetBSD: proc.h,v 1.354 2019/06/21 01:03:51 kamil Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -395,7 +395,6 @@ struct proc { #define PS_STOPFORK 0x00800000 /* Child will be stopped on fork(2) */ #define PS_STOPEXEC 0x01000000 /* Will be stopped on exec(2) */ #define PS_STOPEXIT 0x02000000 /* Will be stopped at process exit */ -#define PS_NOTIFYSTOP 0x10000000 /* Notify parent of successful STOP */ #define PS_COREDUMP 0x20000000 /* Process core-dumped */ #define PS_CONTINUED 0x40000000 /* Process is continued */ #define PS_STOPPING 0x80000000 /* Transitioning SACTIVE -> SSTOP */