From nobody Wed Sep 14 23:33:15 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MSc8W47Y4z4cTyf; Wed, 14 Sep 2022 23:33:15 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MSc8W3ZNCz3rcf; Wed, 14 Sep 2022 23:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663198395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ByM4GPiZxMK6O5+101C/IPp93/5uQlE+6/CYyAHAAFc=; b=dzJS1ApHeohqwQuPu4rno/KDkecjJbj/SAEzLwewd5clSlB/hMz3b1I7zTgZ5WWUkRK3Jh QjIUXPPlBRNKGseGRNRlV0dn2ThC6f7FQ/mb9ohYHWunHYKyxHyLGbS6JpOVLRAoZP1WrZ zaRakrQ3QuXZPFVcOVOFQ4Y0AGIJiYGNLfHFvLOZqeIsrhqb9XGmz+/Zy3K9V+xZXtwxCM Dwymbd4BG9rnCh1nfwcF7raMbsCYhBATRDbyqTggFZMejI/6eG2SxmeRT9SXo7PnxxhSFU zhLUIY9Rhl7QUye/vPyd/1HPgpS1xWfQcIs9/6JQZvc8lTqLCMM61EgcJFHeGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MSc8W2cGCzqY8; Wed, 14 Sep 2022 23:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28ENXFkn080934; Wed, 14 Sep 2022 23:33:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28ENXFhw080933; Wed, 14 Sep 2022 23:33:15 GMT (envelope-from git) Date: Wed, 14 Sep 2022 23:33:15 GMT Message-Id: <202209142333.28ENXFhw080933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 43fbd0e7a74b - main - lockf: elide vnode interlock in the common case in lf_purgelocks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43fbd0e7a74b75c18e9fc76f371bd85edf6bb0b4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663198395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ByM4GPiZxMK6O5+101C/IPp93/5uQlE+6/CYyAHAAFc=; b=oGxEhs20vPHGqePmxZWzGouzr7e1G6Tty8zbzGIDgMwuCCbc9Z6D7FsxJ5hi8Phe7atoyv GzH23zaQnYyleIRGo4+CdIxRxzHhwdDP21bfjb2pp9GeB8/n89cb6ACoE/z7VfoA6Vzv9d L6zR/pMGuh/CO36Ow4IwS8RK1ooA44DrlSnLepfHxVJsM6+ClfNCLwZt5sQP74yoUoQHb9 jMQcpfts//GYXBVlZ8hcQFDQIaKF1FcHRb6Zsi9yu5EfmOWewV+J8Y2gWgKLXCM1BPw/mg p3385Gj8LkyUSzKCrnZQvkBg2t/j+9rnse9KMvSAJK2BSUMTOF58qyev75GSsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663198395; a=rsa-sha256; cv=none; b=y26Swm0+dnUSvXU5a4j7D3ZZuN8l/KEz/Dt3Oi6k0vKJIAfhgVdxZQzAc29c95ZrFpOuCY ivjiHKOurnSQkc4IciUK2CHT5JDoD433fxLvkdSIsBFweDJeAVLE75oFbSZktZ6Wl1lI2w +IBNm/1DWL/IMF/BZvf+HhOttaSEiVHxrjKS6WLBeQi4nw7R8SA8AurPP2wFGTULpuw85V xZEM6CaRmmKb0R3iaoGTVRKwBMZtm5nOCVVQC9O1pGqHZGs+mcID1SWLgeM6EKN6grSQ2V bUDIWBLNdG7fXoIGVyq/9RpoNeitaBLJkDjzkSAGn+VNbBUFDEhRGiBxS+sQSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=43fbd0e7a74b75c18e9fc76f371bd85edf6bb0b4 commit 43fbd0e7a74b75c18e9fc76f371bd85edf6bb0b4 Author: Mateusz Guzik AuthorDate: 2022-09-14 23:04:22 +0000 Commit: Mateusz Guzik CommitDate: 2022-09-14 23:04:22 +0000 lockf: elide vnode interlock in the common case in lf_purgelocks The interlock was already taken and released when dooming, thus by API contract locking state cannot be legally installed. At the same time the state is almost never there to begin with. --- sys/kern/kern_lockf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index 98e29b2c9292..171a0a861c6d 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -764,14 +764,13 @@ lf_purgelocks(struct vnode *vp, struct lockf **statep) * sleeping waiting for locks on this vnode and then free all * the remaining locks. */ - VI_LOCK(vp); KASSERT(VN_IS_DOOMED(vp), ("lf_purgelocks: vp %p has not vgone yet", vp)); state = *statep; if (state == NULL) { - VI_UNLOCK(vp); return; } + VI_LOCK(vp); *statep = NULL; if (LIST_EMPTY(&state->ls_active) && state->ls_threads == 0) { KASSERT(LIST_EMPTY(&state->ls_pending),