From nobody Fri Nov 15 23:30:52 2024 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 4XqtYm5MFBz5dj0c; Fri, 15 Nov 2024 23:30:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XqtYm3Fr4z3xfb; Fri, 15 Nov 2024 23:30:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731713452; 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=W6rLbe1N5BgFdO0xxoqV7zTeBk1COPVZUDni4PJPR1s=; b=uf1CPRZWr4mT7gjmtN6wsMQG3+6JdbjCYjGz5pqkSPT3/Qd0mWOVs4VboB0Ez7Hv6q/rtg 2g7QUmfGEQYX5EPhI2RL/xc4pcNoT3KPRUYPk0wya0F768OPQQAl/qokaxcR/V2ZLuBiYt BDz/iyz4nGqWAPnFC+aWuCRKI8VrFJjcJ+rdR4LN6rlf/t03KFpqvN/UUhNRRcQsSoeAtI Q2smR4l4cqK+aoYie45eMddLKyHmYlha3fLQUZB/KmGO8mehd3lrj5MjDZpttdEwMZn4Qn +QlIT/zFma98VsnSSKWLaHFGFTG5Kdnz6izYDkUMSppG6kRIPOp0RR11J3Whgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731713452; 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=W6rLbe1N5BgFdO0xxoqV7zTeBk1COPVZUDni4PJPR1s=; b=IDdJYezovgE1m7VnneDBPS5m/pjdEt1eqQ62djhSvGfVP2WErw4trvY1N4ehFThEvWe3k4 khBSyOSf8yVzPWztKbAeAT/dfFpMIvrluMYwu8teFX0U0Pz/hTyDLjEW8V0Rvv/mKxCcpf /lweHc1sPFHLwvZIaC9hqMttnXUheTjk0sLZ2bxXMMA2APaGm2DgO2rqb35T1pbRXtExRx rs37GWmH1qtS212+TLWcDjAgTtCTG3UDODpYxv9TtJ/1kUZL6r1vqm7/YvCJajxiPUcq4N dGrcuIO0RfMYvdWhIVpnaJkIBH13EoM7tlRRcDKf6eQCNoWSNQe/lKP2PGP9ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731713452; a=rsa-sha256; cv=none; b=pdITHDDPSXPsdqYFX/QIk0vhx+7bghkFx3ldCts172VV4w34b5vqh0qbNoY7sIkCYTEVQX HOby+DMihvnZayMUBeEGiCBSjcQ9CtwwVxRYOiYDK8/ST4Rjm1szInuZGA9HlOwK+PtMdR PrBrf+NgEuCAsYtE8sWMwmlPDu4DDq43g8N2cU3IvOow5tN3bZTjTJg7n4obX3WizQ3RWU dopK+QeU5fRgGQkLoid0YAhF+W/GO+YKLVZEW9jLE+lUaAeB52okfHL42n/l0o2rijCK/o bkUns2MFyFuXiu2cBuO6QPBlIqeQPY5JKv5ITBqr3AEh/AKnKO0Hkp+maNr09Q== 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 4XqtYm2CfFzjtB; Fri, 15 Nov 2024 23:30:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AFNUqUB042130; Fri, 15 Nov 2024 23:30:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AFNUqiF042127; Fri, 15 Nov 2024 23:30:52 GMT (envelope-from git) Date: Fri, 15 Nov 2024 23:30:52 GMT Message-Id: <202411152330.4AFNUqiF042127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c16d0924dbb6 - releng/14.2 - Revert commit 8733bc277a383cf59f38a83956f4f523869cfc90 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: c16d0924dbb6c1152c45f85b61894ba5dd61e587 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c16d0924dbb6c1152c45f85b61894ba5dd61e587 commit c16d0924dbb6c1152c45f85b61894ba5dd61e587 Author: Kirk McKusick AuthorDate: 2024-11-13 19:37:14 +0000 Commit: Colin Percival CommitDate: 2024-11-15 23:23:13 +0000 Revert commit 8733bc277a383cf59f38a83956f4f523869cfc90 Author: Mateusz Guzik Date: Thu Sep 14 16:13:01 2023 +0000 vfs: don't provoke recycling non-free vnodes without a good reason If the total number of free vnodes is at or above target, there is no point creating more of them. This commit was done as a performance optimization but ends up causing slowdowns when doing operations on many files. Approved by: re (cperciva) Requested by: re (cperciva) (cherry picked from commit ab05a1cf321aca0fe632c1ab40f68630b477422c) (cherry picked from commit 2ca9c96dc0cf0d1f91b37346bce8fd0dd1639ddd) --- sys/kern/vfs_subr.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 646339987ba2..747cdf722cc9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1961,25 +1961,11 @@ vn_alloc_hard(struct mount *mp, u_long rnumvnodes, bool bumped) mtx_lock(&vnode_list_mtx); - if (vn_alloc_cyclecount != 0) { - rnumvnodes = atomic_load_long(&numvnodes); - if (rnumvnodes + 1 < desiredvnodes) { - vn_alloc_cyclecount = 0; - mtx_unlock(&vnode_list_mtx); - goto alloc; - } - - rfreevnodes = vnlru_read_freevnodes(); - if (rfreevnodes < wantfreevnodes) { - if (vn_alloc_cyclecount++ >= rfreevnodes) { - vn_alloc_cyclecount = 0; - vstir = true; - } - } else { - vn_alloc_cyclecount = 0; - } + rfreevnodes = vnlru_read_freevnodes(); + if (vn_alloc_cyclecount++ >= rfreevnodes) { + vn_alloc_cyclecount = 0; + vstir = true; } - /* * Grow the vnode cache if it will not be above its target max * after growing. Otherwise, if the free list is nonempty, try