From nobody Wed Nov 13 19:46:57 2024 X-Original-To: dev-commits-src-main@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 4XpYhK4ZJkz5cVv7; Wed, 13 Nov 2024 19:46:57 +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 4XpYhK42vmz4Fbs; Wed, 13 Nov 2024 19:46:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731527217; 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=4MJXem+4C4Uq8DtlgSuRxHECim2i8DyuhFyk12GKtTg=; b=eyCLOXAFPcm3/j0GF46GtIMEMLI23SLzPRRzmZyEqXSr59TxRVxqgB7cDCAyroCbYjdvls KzCZWreB6mktaNaRJlQwcvNK8r93SUFXmbwT+ySg3AyrDoi5VzElTEOM+Ma3L4YMYFi+lH wfM13Oqnz8FnWPzNyjqGXNkMkIjSI9LxeTb8I38rtTZj2GSBaqhJqgCd39FWLHR7wPGApp JXAirdhyAIiZogVx5s4nOJIq1cHhkQS4BuE76bMXFSRN7eWcod+WTpa6SO+DGAEEntwmI8 yqqPxu78mf0BVeAq31CLvqrEpuQNLwPWkbgYiuUxAI3wvu50kT3K2jMhGN914g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731527217; 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=4MJXem+4C4Uq8DtlgSuRxHECim2i8DyuhFyk12GKtTg=; b=FCLNYy7BqjxnQ1Pun/kZAklW1lZns7EXFMlC1k85AwYf//mwPipVOPJv4KdotXSbhXVyUV yOaO5KAvjf8aX0kdBUJp1Zc6GwkE7ph85ZKdwKaXqa2n9EilkBlifa0keazEXWxeQLHZ6W ViDKXbjquNGu2x7GivJKJTV+NfHc0B07YHebzArgz25a8/nGdTJQr5FNRzfS/6z/fx4Olo cW0CjcLUKyiepAqaOLRrRmjvPCm1sGUhWwzDcnaA/IH0UKcnglr/We8vA2qqzhIvWBuTs5 Hh9G6sLWftynXOsFrg6YLF7W+j8iwPTU2tvqmGVWEKg2ko+1tfeagOV3bhJ+JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731527217; a=rsa-sha256; cv=none; b=oSXW1AXXUO3ErlVAtqJfss/5vAEENwOGt6kzFc9A4NCBSlDB6CUNp88ymwz+JRGBipZ2lb DmmbjTQRcvD9dExCKc6qn4MUBCa6JG7Y7HHsNCMUAHS4Jfvn9+Q6Ic7acW67495t2tszyC Zw1vp2HX/4bsHOJdoXWqHt3Q4X1sDHbLPlMY29Rt4QhvBmtZY+eNwHpo767hdT2z16Z/ig xPa6+LraUgpprIFpPRBbBq6HjXvJuAd1rtdMlCn3qEVBM3v8HVDTtiUL14eyv01wR1+p2W xbgswUFi95Dlz/BT/zpoc4GnIfYUthoyFKNLkoC9S9xCXL82VxysPfLNXcz/BA== 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 4XpYhK3W7sz1758; Wed, 13 Nov 2024 19:46:57 +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 4ADJkvEQ070271; Wed, 13 Nov 2024 19:46:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADJkvKA070268; Wed, 13 Nov 2024 19:46:57 GMT (envelope-from git) Date: Wed, 13 Nov 2024 19:46:57 GMT Message-Id: <202411131946.4ADJkvKA070268@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: ab05a1cf321a - main - Revert commit 8733bc277a383cf59f38a83956f4f523869cfc90 Author: Mateusz Guzik Date: Thu Sep 14 16:13:01 2023 +0000 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ab05a1cf321aca0fe632c1ab40f68630b477422c Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=ab05a1cf321aca0fe632c1ab40f68630b477422c commit ab05a1cf321aca0fe632c1ab40f68630b477422c Author: Kirk McKusick AuthorDate: 2024-11-13 19:37:14 +0000 Commit: Kirk McKusick CommitDate: 2024-11-13 19:46:47 +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) MFC after: 1 minute --- 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 3b00fdbe93b4..f9b2a4fb68d1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1992,25 +1992,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 there is at least one free vnode, try to