From nobody Wed Oct 04 12:08:50 2023 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 4S0tl65VVTz4vntJ; Wed, 4 Oct 2023 12:08:50 +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 4S0tl64T0Mz3Hyg; Wed, 4 Oct 2023 12:08:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696421330; 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=YDc9Y/2q3KcFnS3Kc1le+XlTyD46WJXOK2prC3mke68=; b=JfADtfVTbuiF97ahdl+Xr7CvtLkbCjq/MytfxdP8zlPG7oTMezqeMfkzkX2xIJd6LRtPgy tTHpV1COEQPNo615tzXhggerX+WmH+3z4KOMuY+j+1Vqnc8+M48kpvSbtpvOliwa5BQ3wW +mmi9KojiJKiKvDxsp8wFkznrX81CLfaY+ujgaxXpQukrTCCwkTu7CqIsubL6l6JsEMnY3 kvUCfjrL/MEP8ZtUIV++UXzQCxNebTRAy7poCxNgD/OR0GZUnWLM6XvoMQW975vs4WRfcY Fy6gIgbVbSbu3bjNp9JZKmLCbVTv3ndHxOEMpXm2NhBJw3zsg3ulu0wYPrG3zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696421330; a=rsa-sha256; cv=none; b=dHbVyej3bF3Be1QsJtCdcMOgW6omzlLamIjkek2Lmy03PDJCfKScpnKlUupMZ64x/Pqwrn /hx3WeNqxinKvh3KG/ngjov0THbXcgFXYek/OsTWv7TPQShka9i4sI8Vguj5cG8C2i8jmi NEqlpuCiX/abpNHh9fQGpr0lpgdBBGs7SLv74TwfaaMch8hybgnb4fAbOOsJRH3+GpTRRS IJjsh0agsv8WdA88BnaJ+zRFGmHpZOhU7FlMphOBdZGFpw6nbzuQDjoa9P3TzDxzBtKHHD vBoy/BOrJCx+zP3e+m3TW738lYK85B/bxqpDQJ1nkqZqhMum/pbNtnvD0cfyKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696421330; 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=YDc9Y/2q3KcFnS3Kc1le+XlTyD46WJXOK2prC3mke68=; b=X9wu4L1fy/+7ASwT1r2UvFi7h4PmZwpni0jFRItu8I2e5tXfvqFkSsJ9t/8hfeJ50ve7/V DEC5lZNBp+ftwPERq9ffAldcrohVfvcC5cu8NQQjs3CG1LeWmVnMu2oWGVKiSzlMtrwZB5 5y1tlvL5w2hE6dmhsgAokBas39PXxq4n6nhWs8taiU/KJNXE2mE4ev/iXvw0K28exoNzBF 4RXIt3GdvDlAHD74VaydNq3oSJL0p/NzDvjJMUKmEPILESpawmVH/J+vVZGvcDujO3n0ho /h7R/u6iHfYZpeH0hzsKram88ZGOw06Gj8sfNua5flKRvUBsn8pqJ4I9Rg9H5Q== 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 4S0tl63Z2qzcM6; Wed, 4 Oct 2023 12:08:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 394C8oXN053188; Wed, 4 Oct 2023 12:08:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 394C8or7053185; Wed, 4 Oct 2023 12:08:50 GMT (envelope-from git) Date: Wed, 4 Oct 2023 12:08:50 GMT Message-Id: <202310041208.394C8or7053185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 3a99c0acc1e6 - stable/13 - vfs: don't kick vnlru if it is already running 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a99c0acc1e6184862ab83b173fe740ccff9c3f6 Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3a99c0acc1e6184862ab83b173fe740ccff9c3f6 commit 3a99c0acc1e6184862ab83b173fe740ccff9c3f6 Author: Mateusz Guzik AuthorDate: 2023-09-14 16:27:47 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-04 12:04:15 +0000 vfs: don't kick vnlru if it is already running Further shaves some lock trips. (cherry picked from commit 76f1153790b6d2e1a4f0389c3ac24e41d08f9ba6) --- sys/kern/vfs_subr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 40f7a6d33c20..f58c8920dc4f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1572,9 +1572,11 @@ vnlru_kick_locked(void) } static void -vnlru_kick(void) +vnlru_kick_cond(void) { + if (vnlruproc_sig) + return; mtx_lock(&vnode_list_mtx); vnlru_kick_locked(); mtx_unlock(&vnode_list_mtx); @@ -1828,7 +1830,7 @@ alloc: mtx_assert(&vnode_list_mtx, MA_NOTOWNED); rnumvnodes = atomic_fetchadd_long(&numvnodes, 1) + 1; if (vnlru_under(rnumvnodes, vlowat)) - vnlru_kick(); + vnlru_kick_cond(); return (uma_zalloc_smr(vnode_zone, M_WAITOK)); }