Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 10:58:33 +0000
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        "Mateusz Guzik" <mjg@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r329639 - head/sys/kern
Message-ID:  <2A592C68-C6B3-4BAA-975C-02D325292C02@lists.zabbadoz.net>
In-Reply-To: <201802201052.w1KAq7jQ057924@repo.freebsd.org>
References:  <201802201052.w1KAq7jQ057924@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2A592C68-C6B3-4BAA-975C-02D325292C02>