From nobody Fri Oct 13 23:53:53 2023 X-Original-To: dev-commits-src-branches@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 4S6jyT36Swz4wy3C; Fri, 13 Oct 2023 23:53:53 +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 4S6jyT2Zjqz3K0L; Fri, 13 Oct 2023 23:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697241233; 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=9twF7pPUx0oy6rpdpaGrij5u87ejzZcG+UMH47CtYyU=; b=klTnKcK2n/REbtq9+dwEIYtkakj7aHX6lp4jjJCn2H350wZsaJw19/2OPLgOW1pV5O3cgq fiWfudDiMIj9sp+xxQprfM9ehW7GtaYApag4VP7sW4QL1cg2BgTh+qPBi3dhnTRi237aY3 7YNmJTu2JO21kuL/B/2pC1zGVzwkm6UQmmc6OUhgNYSLKmzW5Bz5gnIyXWi4EoG5UY+5ZL VXKT8odCH4LaP8i5pkf0XKHacnBLQdveeC3zEN2QvVFLkBU8sE85IB2uzVCwiaHuorsIGa mv45Sz1FB/nC2pch+OoVrFiV1peiCsIfEPyuXGaO1OJDX4usTkNzDpnA6Sp1Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697241233; a=rsa-sha256; cv=none; b=Wndy4s4PV9Uy9AVYMgbiS/92c4y0BoYA0nhwR/e/aT+dbtcHxMylxso2hSmJJds0bzAtxQ hmven8kaqn7hipQqdd5qTyLYpp1HtsaLqx5Jj527lqdtrhAJOrsRSB418relDn7jmKrEWA Z86n+8hVSAUqXUhr1LHjC2idm+FHjxm+gO/n6PsMhHJlrZtbr5uqoxi+gRH51X+ZBCilV5 om15q5zWg/Zj8T0Zczgop+IvwyZuVTc3tkrASx7B5nMFxsect72hZ/Z6/AIXpPJclzcTPo WtlcGVhVIxSlLMIiqBO8BAkYcEalQZwXiLEMO26qlrC9NC+8VQFT5SEyPu60tg== 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=1697241233; 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=9twF7pPUx0oy6rpdpaGrij5u87ejzZcG+UMH47CtYyU=; b=pdxv3ISkQuJtTXEqEXW81Kbg6ZFYcnH0dgAW2wGEZLLRyKQOnlYMcJ3L0/DmNgEAFqJWi/ KPyRdUqFuuH+X5iJe4/nuqgB6JfEcwq9baoZGQ/swkAsAr1cA+Gqcvy9Te4qYCg9eqCxDD XRZEaRIFq0udRb2CSNZvCwkPlvwFTSOOyilEcARX1brjneAmJEoN0blLYhVXdssRSj+sTx 0s0fIwtDvZVIjR3gSoyI6AkyDByhl6Vqv1d7PpPcDKUObXSG1lCeSR1gqIf0uRhTBIRzQP Fa96L9PsVZMylVj0J4Lth59TP/SfiQqEp5+jhHB6aJXrJFkClmCPxbNYGFNPWw== 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 4S6jyT1gz0z17Vq; Fri, 13 Oct 2023 23:53:53 +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 39DNrrYQ032168; Fri, 13 Oct 2023 23:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DNrr37032165; Fri, 13 Oct 2023 23:53:53 GMT (envelope-from git) Date: Fri, 13 Oct 2023 23:53:53 GMT Message-Id: <202310132353.39DNrr37032165@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: f71e2bbc5e24 - stable/13 - vfs: be less eager to call uma_reclaim(UMA_RECLAIM_DRAIN) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: f71e2bbc5e24e53946f7a93ca49f7ac8ca2bd7b6 Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f71e2bbc5e24e53946f7a93ca49f7ac8ca2bd7b6 commit f71e2bbc5e24e53946f7a93ca49f7ac8ca2bd7b6 Author: Mateusz Guzik AuthorDate: 2023-10-10 16:15:53 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-13 23:48:13 +0000 vfs: be less eager to call uma_reclaim(UMA_RECLAIM_DRAIN) In face of vnode shortage the count very easily can go few units above the limit before going back down. Calling uma_reclaim results in massive amount of work which in this case is not warranted. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 1bf55a739e754765fa2dc15ab6481fe411084be3) --- sys/kern/vfs_subr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c5a99179af36..29b255b418e4 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1691,7 +1691,12 @@ vnlru_proc(void) target = target / 10 + 1; done = vlrureclaim(reclaim_nc_src, trigger, target); mtx_unlock(&vnode_list_mtx); - if (onumvnodes > desiredvnodes && numvnodes <= desiredvnodes) + /* + * Total number of vnodes can transiently go slightly above the + * limit (see vn_alloc_hard), no need to call uma_reclaim if + * this happens. + */ + if (onumvnodes + 1000 > desiredvnodes && numvnodes <= desiredvnodes) uma_reclaim(UMA_RECLAIM_DRAIN); if (done == 0) { if (force == 0 || force == 1) {