svn commit: r329639 - head/sys/kern

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Tue Feb 20 10:58:40 UTC 2018


On 20 Feb 2018, at 10:52, Mateusz Guzik wrote:

> Author: mjg
> Date: Tue Feb 20 10:52:07 2018
> New Revision: 329639
> URL: https://svnweb.freebsd.org/changeset/base/329639
>
> Log:
>   Make killpg1 perform process validity checks without proc lock held.

I appreciate all these locking improvements!

I would feel a lot more easy about them if the commit message would also 
detail why these changes are possible (e.g. only read-only variables 
accessed, or variables only ever accessed thread local, ..) and not just 
what the change is (which the diff also tells).

Also, are there people reviewing all these changes?


/bz

> Modified:
>   head/sys/kern/kern_sig.c
>
> Modified: head/sys/kern/kern_sig.c
> ==============================================================================
> --- head/sys/kern/kern_sig.c	Tue Feb 20 10:35:13 2018	(r329638)
> +++ head/sys/kern/kern_sig.c	Tue Feb 20 10:52:07 2018	(r329639)
> @@ -1677,12 +1677,11 @@ killpg1(struct thread *td, int sig, int pgid, 
> int all,
>  		 */
>  		sx_slock(&allproc_lock);
>  		FOREACH_PROC_IN_SYSTEM(p) {
> -			PROC_LOCK(p);
>  			if (p->p_pid <= 1 || p->p_flag & P_SYSTEM ||
>  			    p == td->td_proc || p->p_state == PRS_NEW) {
> -				PROC_UNLOCK(p);
>  				continue;
>  			}
> +			PROC_LOCK(p);
>  			err = p_cansignal(td, p, sig);
>  			if (err == 0) {
>  				if (sig)


More information about the svn-src-head mailing list