From nobody Fri Oct 13 23:53:56 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 4S6jyX68Gqz4wyQF; Fri, 13 Oct 2023 23:53:56 +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 4S6jyX5fqlz3K68; Fri, 13 Oct 2023 23:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697241236; 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=62S2fYi0R20VcnkTO5DWVGKL7Rgw9T9TTXdOzSXtFp8=; b=xmD9P5WkEzXVN+eMVJboZakZ0pEiPiaox3RX5Q/FN9Zg7t5eyrgz36uhswMMrMuoLNlpiT nrS6jyexkX5l3Bx+EZlvDf3QCCAW7PPKy9WgmPKQNnRTf7v5j1PehKgDH80tTDtZhqSS2+ 8ChutaSzu7YaxjHSoesUFlpq33kP02XwIlGPIQjERvpumCiq3Mn32G+KJoYdBdxILUfc0c WpZ/9dtiJ8+/0Pb8L9VRoz3JQ4daJPaCGFdbZYI/W8u4hiXSl0lIXUOP/uaLYWn+jj9iAI /KA/2GEKCsM2bu+jI4yMkAtgfcM0SJ9GUFa69J4V2t5p9OVreOsndmqD3MmQBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697241236; a=rsa-sha256; cv=none; b=xqLEFRNi2K6jcqnam6bDM9TzdiLsW/Tq/clQyIsFeS4YCZSgvF9/sC8OsvCfPpG2YCaAmC ccmX0yqOUTll7kQM2Xyalx8TaWQo1q2UwaFN4lr2mTArQeqp9v01s1h7W4vuijPWmNZ69B hlyecdtDTFINfG63ukzrTjYtkwi51p2zv+QdU6xOVBjIeDXKDBVpHlJVOR8Kl75w90suJK cW56foiKNwTLEYm3/rrEBUo16bgr7as2X7S2W75Pao0cQhGL2J5noSQ7ToXp135jbJD4Ug NSxTGId3Tp/cKEEqcczlL0WMAJLlKutudqCTLbaDlZ+wEdxKQjGdt8BVfm4Q6Q== 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=1697241236; 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=62S2fYi0R20VcnkTO5DWVGKL7Rgw9T9TTXdOzSXtFp8=; b=gxf4fXWOhCPcWyKCFQ2IU58HL2wE5U7eZX3m4GzI5+n2BWRIerYkcEFAkgl7k6C/pRJOcK LOR1iGLqusCs6uTcxqrVGeAor9L1HgruO0N2a/js1M17TItlj7KOcdxQay4DAMYBNnaIbN YEUqIYNGgEzJJpkXrlCkpVdOdRCkoxisY20v27lCwdIanbk/C58ph8urPYYBOio0oW9dVe THSOft51M6PSZRdGqIBJb3NT9KxjJvqo4yoZDAZpCCm6Jccs590eYlgkfqYMQxHYN4XQf8 dT+WChfwyq5c9ue168auqoTDsHG5GEu1itmACBLWU/A5knPGeofgzaMs+IKohA== 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 4S6jyX4ljJz17nf; Fri, 13 Oct 2023 23:53:56 +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 39DNruZJ032322; Fri, 13 Oct 2023 23:53:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DNruhD032319; Fri, 13 Oct 2023 23:53:56 GMT (envelope-from git) Date: Fri, 13 Oct 2023 23:53:56 GMT Message-Id: <202310132353.39DNruhD032319@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: e47ede47277c - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: e47ede47277c6e3c8a5a8077200179e4065fe7fc Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e47ede47277c6e3c8a5a8077200179e4065fe7fc commit e47ede47277c6e3c8a5a8077200179e4065fe7fc Author: Mateusz Guzik AuthorDate: 2023-10-11 06:39:48 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-13 23:48:13 +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 e4b9ff8e1ba6..54796fe6ef7d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1673,8 +1673,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); @@ -1751,7 +1755,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);