From owner-svn-src-head@freebsd.org Tue Feb 20 10:58:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E2E4F1C67D; Tue, 20 Feb 2018 10:58:40 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C0A9E70785; Tue, 20 Feb 2018 10:58:39 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id DC6D825D3A80; Tue, 20 Feb 2018 10:58:37 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 20942D1F7F1; Tue, 20 Feb 2018 10:58:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id aCYBBLT18PjW; Tue, 20 Feb 2018 10:58:35 +0000 (UTC) Received: from [10.248.122.60] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 3A427D1F7E5; Tue, 20 Feb 2018 10:58:35 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Mateusz Guzik" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329639 - head/sys/kern Date: Tue, 20 Feb 2018 10:58:33 +0000 X-Mailer: MailMate (2.0BETAr6103) Message-ID: <2A592C68-C6B3-4BAA-975C-02D325292C02@lists.zabbadoz.net> In-Reply-To: <201802201052.w1KAq7jQ057924@repo.freebsd.org> References: <201802201052.w1KAq7jQ057924@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2018 10:58:40 -0000 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)