From owner-svn-src-all@freebsd.org Mon Sep 2 12:46:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34832DD255; Mon, 2 Sep 2019 12:46:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MVFw0Yqwz3C8H; Mon, 2 Sep 2019 12:46:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E62711A39D; Mon, 2 Sep 2019 12:46:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82CkhLV035654; Mon, 2 Sep 2019 12:46:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82Ckhah035653; Mon, 2 Sep 2019 12:46:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909021246.x82Ckhah035653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 2 Sep 2019 12:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351697 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 12:46:44 -0000 Author: mjg Date: Mon Sep 2 12:46:43 2019 New Revision: 351697 URL: https://svnweb.freebsd.org/changeset/base/351697 Log: proc: clear pid bitmap entry after dropping proctree lock There is no correctness change here, but the procid lock is contended in the fork path and taking it while holding proctree avoidably extends its hold time. Note that there are other ids which can end up getting cleared with the lock. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Sep 2 11:04:17 2019 (r351696) +++ head/sys/kern/kern_exit.c Mon Sep 2 12:46:43 2019 (r351697) @@ -906,7 +906,6 @@ proc_reap(struct thread *td, struct proc *p, int *stat LIST_REMOVE(p, p_sibling); reaper_abandon_children(p, true); reaper_clear(p); - proc_id_clear(PROC_ID_PID, p->p_pid); PROC_LOCK(p); proc_clear_orphan(p); PROC_UNLOCK(p); @@ -914,6 +913,8 @@ proc_reap(struct thread *td, struct proc *p, int *stat if (p->p_procdesc != NULL) procdesc_reap(p); sx_xunlock(&proctree_lock); + + proc_id_clear(PROC_ID_PID, p->p_pid); PROC_LOCK(p); knlist_detach(p->p_klist);