From nobody Wed Oct 11 06:41:09 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 4S537p1GpQz4x07Z; Wed, 11 Oct 2023 06:41:10 +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 4S537p0qBRz3WJ0; Wed, 11 Oct 2023 06:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697006470; 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=TysqYqi1RaYYQCfeGlfJWCRey371gRzf64/Rkdfz1/w=; b=QnE5elR6woXpwRkQ2R3fjllnAy7PHRrLinaK7oUYsH1/NDRISoxTRDVtdSM4dLI8XlPdo5 w63F89LAD6zM1P6dnjEhp4K3njnQ5Z/cSDYCbfNbSEKUgd/DyNOu4H3jE85dLsKYi/IQmm O6JjsoSWAjCK2Nz3JP26iyHuwhMDKALvcGb8tDgiCmKCIkNw5C5p9aJMwg7u2Fw6zKW1IH 9M+/uyyHwhPBiBwFOzCNKolvrlgk7Gt1G6p7kH1Hl3QuBBaFs+WH9WtRaj/T2rlqM7ci/j Kq0w4vXZjcXCtZ20G4c/GTPE5oxJpFsEyBUGG6IBkh1r/SlM5kolH3EJWyuuNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697006470; a=rsa-sha256; cv=none; b=lwQ0CYPAcyig9PrsFwy+C3M6U7Lcm9rnFul92VWs2GXKUiSSV4mTcFpn25WM/LF7HPQPl2 f88JqEGvCAQ8krDi6EF+JZqaTJwNmbNNiHCR+lpTmwc04fkJOhN1FLCOaLwv/tI51p1zI5 /DJZgb9Jdp24CBcwstpIUtYkQ3t7p0PcaG9h7pimEwUgWFMjQY19hB0qgID7cg7CkSXVxi yrwwv0mQ1TqxYC8mxIjs92LdUzTd5CBHgDg3ccuSs9pbqL3TlWkNwLm6zP5BDRs3idelfR 5+qfloVxMWVGirAVYw/pGun0APU8BoVgF8fZTnQMJv4M3CIodtAHaqyLgEvFZg== 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=1697006470; 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=TysqYqi1RaYYQCfeGlfJWCRey371gRzf64/Rkdfz1/w=; b=l90paDFgVk0rUPamJHVtUVvoVNHs2EbKStYNT9N8ywsVyRtHBgRZa7d7yu1N3cbgluavXY Jc3QceOHnoLND0Y3xWSV2A+3SJFOl7rKHY/0MqvDhOZH3NnqXiEhnkVTxZ/fixE2JVDI4d guWdOT1OP+600Yir6LXquPDyRfd8SpeUtSzhUaxP51p9bKiQnjqQMnqldTQvpuJDkuG1Ax ID9eOdqknJRUz73SWuL7obj41oUjVQWjPv0nYYDMBVbZDDrlhlnSWXDuAeVikjRZ/Xfri2 AGSrft+Ax3UmkNMcOBTmg3d4m4jDNAxLQDV8FHt6QHO3H5pOPbKuTzE5KIvCZQ== 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 4S537n6zV7z19jl; Wed, 11 Oct 2023 06:41:09 +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 39B6f9hJ014930; Wed, 11 Oct 2023 06:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39B6f9Jx014927; Wed, 11 Oct 2023 06:41:09 GMT (envelope-from git) Date: Wed, 11 Oct 2023 06:41:09 GMT Message-Id: <202310110641.39B6f9Jx014927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: a4f753e812d8 - main - 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/main X-Git-Reftype: branch X-Git-Commit: a4f753e812d8913e9be481c6dfa1574c7f032a56 Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a4f753e812d8913e9be481c6dfa1574c7f032a56 commit a4f753e812d8913e9be481c6dfa1574c7f032a56 Author: Mateusz Guzik AuthorDate: 2023-10-11 06:39:48 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-11 06:39:48 +0000 vfs: don't recycle transiently excess vnodes Sponsored by: Rubicon Communications, LLC ("Netgate") --- 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);