From nobody Wed Nov 13 19:52:18 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 4XpYpW04jDz5cVvl; Wed, 13 Nov 2024 19:52:19 +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 4XpYpV6k0Kz4Fs9; Wed, 13 Nov 2024 19:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731527538; 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=LyP4JmA+mDYJwCFRK4QEfJbvowIyi/beAlcU1GQqncA=; b=ghul+yqw+RgD5U5/wfy0IwVTiyeRa6S8gTw0aaEKA6S9nSUIxxyaOkFWgk18Q7A5uC4mHZ bKcJU1FiZEqiqCcrGWnJrU5vwI8esaWA9/c5vl1+rvsA/LGX6gonHhDLtlO4WhbxDXuYFb aFMBVFjYqXvTM2GtR09FNC3VsLMw4eYgTEVkfo5hf8DTEqNmiGIRAJKtZRop6CdBWcPXt5 ICGDPyG2KX8dsysT2+wtE6hwGVd02JYjaeAfVDyVmaPUi5NygFeY5zMhdgf4DUq+dRVlsg rpTx2+F+mPVc/4Rw2PsVR0xMWUUaCLyZEP4PfVg5qxtlSWbckkUhbqBdCEITrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731527538; 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=LyP4JmA+mDYJwCFRK4QEfJbvowIyi/beAlcU1GQqncA=; b=HTB+hJ1O1aUR2ALIfPDxZ2OvlGtggBa/94t79EQQ7pBoJL0NQxvHxS8qV8XZ3iiAfBomRn 4v/h2myWqZ5CN1/7S5d6gJ3dBCzLk672qfHKGs0aB/HrfKbkGohlPyKzc19EfuMexX+Jlg 1n2L8oEWUzLQVwOvm89rBHNsaMulf//9Z41uv/5Apmrn7oS5sAbCR9wSpOxIAbBcN1q9LV s8nOZjCToYogzQCStqVcExIpWTJlvZTFDSOYrdnR+1sfpK+y3Gne3Ekdndbj/S2kXFLVp9 1it0Ocsx9+gvyYTPike+gQGS6aD9aQaxz32k1fgK8q2m3/Dk7tkdt8zahAae7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731527538; a=rsa-sha256; cv=none; b=uCld+hhDNmxFuXC21JWmFzmt7XW/aPswl+9OwrXbIhdlK9agnsgWxNmOxPtx6GoZfIxp3a jDO5P6JnDnbT8baIWCdxrR6QbjFBGIwNaPU01fIXkOmsOQd+ow2dsCNdtJzAbhetE3iXtb DCtVzwFuFFrurQ6SdNXjl83byUkIkmzams9hNM4lHxgRwb88SlO1UYbFqQ7JvB+Gkt2UxF hREd5Pvf897S/XgeM9CPC7hscykRmxczBkEmauDIXk18Q/CYtJbtwWjYKtKtHcfKCsRGyn a2/bsuEBMj/JjO02Mtyvh64zqz355jxn0Y4XMj2uEGjO7pe+HveES5xtB/Kqfw== 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 4XpYpV6Kb3z17Xp; Wed, 13 Nov 2024 19:52:18 +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 4ADJqIRM087181; Wed, 13 Nov 2024 19:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADJqIuK087178; Wed, 13 Nov 2024 19:52:18 GMT (envelope-from git) Date: Wed, 13 Nov 2024 19:52:18 GMT Message-Id: <202411131952.4ADJqIuK087178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 2ca9c96dc0cf - stable/14 - Revert commit 8733bc277a383cf59f38a83956f4f523869cfc90 Author: Mateusz Guzik Date: Thu Sep 14 16:13:01 2023 +0000 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ca9c96dc0cf0d1f91b37346bce8fd0dd1639ddd Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=2ca9c96dc0cf0d1f91b37346bce8fd0dd1639ddd commit 2ca9c96dc0cf0d1f91b37346bce8fd0dd1639ddd Author: Kirk McKusick AuthorDate: 2024-11-13 19:37:14 +0000 Commit: Kirk McKusick CommitDate: 2024-11-13 19:52:05 +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. Requested by: re (cperciva) (cherry picked from commit ab05a1cf321aca0fe632c1ab40f68630b477422c) --- 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