From nobody Fri Oct 13 23:43:13 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 4S6jk970fXz4wxrx; Fri, 13 Oct 2023 23:43:13 +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 4S6jk968Yqz3Fgm; Fri, 13 Oct 2023 23:43:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697240593; 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=gMmFT0YZS02ae0AQVJKkFgN7z5psqT12dwel+d2caOk=; b=U3N4mqzoTDA1yy+hJakfeLi0FzPTxnSlKI7wrpnimE40O5u+HC2GfK+OnJtVr3DjSE8bz6 7qC3+ZOxP6Ldx7WWR+qNaZAwEkMvifGDOVMqHEtfUAZoTZ76EzL9pZu1XvPsb7ubKXx+z+ sTdJNeHla+RQ7TA01mZKofzyd+zA6Mrnd1SAtQ+wYOItJGEyv6iRArKCh27dfcau9bthW8 m98szT9xP3HzqjBET2gyhUrfHBAYmFT0YRRkswMvkWYeEDixsoVqa7GOmEdZ+DVX3qK7nq zLVJmYW2Fc/VE92LR7OmdJ4Uh4fdE/ZcS5oduZXluHo5Arz/5ffJ6+PpGj6I3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697240593; a=rsa-sha256; cv=none; b=SHb5chLaDj7oxrQkbPyQs1hibvsRxsOqipgW0HmLLoAI54XAfuFB5SatRnTPGM5LQwo3Bb 976dm5grhcvH4pIZHpCg8hhMO3aUL305vErN0w+PXolVZgGcmEib68l2hv9JdeCyt1Hoa6 lGE6OptPUQDfyoE101M9rdHpO1eiojaWKJ2LAYgks9QXF6h/YMsZX/J6nG9AMQzX3Z7gzb OWOHvKgB1xC1IHlqirmvbrHAmhDfQ6aE2qDzIPKjIebOYvixDC5KkU8v/I5CV0COUUMD7b RDX7dL8RkEm/pS4EYAg8hltMYTZq8jiftdoZ+XXAp/BARu80mCuEws02RAVWnQ== 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=1697240593; 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=gMmFT0YZS02ae0AQVJKkFgN7z5psqT12dwel+d2caOk=; b=nZKWoNS+4lNE7RmF1nLkCueAGaFDYoVlC3NSbT3d133QynlylkT2+mLKkK2/VqvDc0FI9G TMnJfzkwCUb2k5XcBBX1i/cVamDgnwIADHWOxcmUZx65zYMtTC9U8cXSg8EDIEMCUAL71h OkN11Hz2nvQCFsaKXh3IILLRuo+gBhJ2wpHtG71liOzIYD+icD8Cgo3JBxXjePRRy2yCQX VFX6ADD3VTcM9rA98kv2YkoudBA2R3d+KbWcUimmLo8Wfoq0vC0OuUmR+tEgcHCa/EpIhi FaKCLjmjsfoMOSUQLBtiNotKlF/nQOvKuQt0D+1c8CQn/tgkUoEVz8s1TUL9HQ== 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 4S6jk95Fcwz16ny; Fri, 13 Oct 2023 23:43:13 +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 39DNhDkS014880; Fri, 13 Oct 2023 23:43:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DNhDpj014877; Fri, 13 Oct 2023 23:43:13 GMT (envelope-from git) Date: Fri, 13 Oct 2023 23:43:13 GMT Message-Id: <202310132343.39DNhDpj014877@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: e3b2372a76c1 - stable/14 - vfs: don't recycle transiently excess vnodes 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/14 X-Git-Reftype: branch X-Git-Commit: e3b2372a76c18551529e1aa43d185f602dccdbf1 Auto-Submitted: auto-generated The branch stable/14 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e3b2372a76c18551529e1aa43d185f602dccdbf1 commit e3b2372a76c18551529e1aa43d185f602dccdbf1 Author: Mateusz Guzik AuthorDate: 2023-10-11 06:39:48 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-13 23:41:47 +0000 vfs: don't recycle transiently excess vnodes Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit a4f753e812d8913e9be481c6dfa1574c7f032a56) --- sys/kern/vfs_subr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5834feff080c..52c14b4a234a 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1656,8 +1656,12 @@ vnlru_proc_light_pick(void) /* * vnode limit might have changed and now we may be at a significant * excess. Bail if we can't sort it out with free vnodes. + * + * Due to atomic updates the count can legitimately go above + * the limit for a short period, don't bother doing anything in + * that case. */ - if (rnumvnodes > desiredvnodes) { + if (rnumvnodes > desiredvnodes + 10) { if (rnumvnodes - rfreevnodes >= desiredvnodes || rfreevnodes <= wantfreevnodes) { return (-1); @@ -1734,7 +1738,7 @@ vnlru_proc(void) * adjusted using its sysctl, or emergency growth), first * try to reduce it by discarding from the free list. */ - if (rnumvnodes > desiredvnodes) { + if (rnumvnodes > desiredvnodes + 10) { vnlru_free_locked(rnumvnodes - desiredvnodes); mtx_lock(&vnode_list_mtx); rnumvnodes = atomic_load_long(&numvnodes);