From nobody Sun Sep 24 21:46:55 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 4Rv02l6cMVz4tWyS; Sun, 24 Sep 2023 21:46:55 +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 4Rv02l67YGz4ZVY; Sun, 24 Sep 2023 21:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695592015; 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=PG/PWF0yk4Ef05S6HKPGkI1Mg9xw57XgFnbTCATCm6U=; b=usfl81NA/7KCtMR+XWSjxQe01oQuNms+PXILnC+FIo3RR9rzXgluPdOWK1Ysm9KEeaKVsb yeJjrqPDg9iDdl6el2RFz7G+ERJsaUY4oHinkGzmFCkK3ZjiGvcKU6oCw8V5RmRHnWsnNF jCkz49x/eDisJ78U+iSvCRet6YYzZ9pN+jIUikgEC7FV6ZrZRw5ZKgGKZ2qATOZeb/L5NJ o0v3/hVxT4ZqkRW2tTm8mcId+Yx9jKPKBMfM2+uITtudfoZ1ROie2tHP4C0lAtEuT/wnQH j8vjKmNJsJV8UuNhZHk+50osnMoxfjqZdpPbYCu2EKHZUMjEill78Ngl2eDCEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695592015; a=rsa-sha256; cv=none; b=cnh9H1a3/Z3txXNiOiRmdfYiYmgpDPGS9e33xwVcd3H7Wyr9xpNGzIV8Q5N6UK+uNZLwZf FUjzH4E4LMEnNTnhpEe0NLXzluEU43C7LsKWYuJrieEiWV5Ka6/lVxdAjYF99mTj7dJctQ tD9/bSo5BvQpinXHfl5Aab1KHdgheZjjk14ZHhu1kKVIyBOPVOegNtAo1djXFc/o/jjz7a RagIfw3wkY1CZCAqiQKs/lLMI5esYG/GWcILMaWlzRBClT7PYDUf3GQzOV9OP6cVdE9CLL HZPe8eWKZmmiNC8ioM27N7pLSoKdBLhuZ4eK31jOgxjtOv6b+sDFH5KIpCHMHg== 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=1695592015; 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=PG/PWF0yk4Ef05S6HKPGkI1Mg9xw57XgFnbTCATCm6U=; b=OMZhkLfaKVxZ0qSmcNOfUvPCrmUGSbr3KY0mig6RqdrKkjlwvTcoCqY51hJp13IYUk3JrI TEksX8SQWFNMZ/O2Q3DbGA1nk1SLDBjlbiHbuGUbf6WtuW6loE5IsBZItTiPff1r3vmd4Z t6hRvJZG75mVo493Bltx/qdbyJckK1BSwHGSRPp/HkbaZ87MDzfXP5oaZVQnM0dojOzBS6 WvpM+NbPaZQWW4hM6n9SX+n/T4hSMi/bSgMbMfL1HUcwVhP8bnPJqR4rAoFwirKJBjk/ff o1QRtl5XtymMMDTyHRHBVncjPeC4XeH5QUxw7SyZDpb1BXT3y5Tbn9IHSvsrUw== 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 4Rv02l51T7z133R; Sun, 24 Sep 2023 21:46:55 +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 38OLktCK030709; Sun, 24 Sep 2023 21:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38OLktjF030706; Sun, 24 Sep 2023 21:46:55 GMT (envelope-from git) Date: Sun, 24 Sep 2023 21:46:55 GMT Message-Id: <202309242146.38OLktjF030706@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: 4e5833d9aeb9 - releng/14.0 - vfs: use vnlru_read_freevnodes for the freevnodes sysctl 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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 4e5833d9aeb9c7cb94aa70f40ddc96aecd84bba1 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4e5833d9aeb9c7cb94aa70f40ddc96aecd84bba1 commit 4e5833d9aeb9c7cb94aa70f40ddc96aecd84bba1 Author: Mateusz Guzik AuthorDate: 2023-09-14 23:53:11 +0000 Commit: Mateusz Guzik CommitDate: 2023-09-24 21:45:59 +0000 vfs: use vnlru_read_freevnodes for the freevnodes sysctl For a more accurate result. Approved by: re (gjb) (cherry picked from commit 03bfee175269960c67cab64d761bbb5eb9ac5878) (cherry picked from commit 07c081e59232433ce522cfdf37bc4a8afad75330) --- sys/kern/vfs_subr.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 84219f3b5c12..823b8005aa4d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -184,8 +184,6 @@ static struct vnode *vnode_list_reclaim_marker; */ static long wantfreevnodes; static long __exclusive_cache_line freevnodes; -SYSCTL_ULONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, - &freevnodes, 0, "Number of \"free\" vnodes"); static long freevnodes_old; static counter_u64_t recycles_count; @@ -350,6 +348,19 @@ SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_maxvnodes, "LU", "Target for maximum number of vnodes"); +static int +sysctl_freevnodes(SYSCTL_HANDLER_ARGS) +{ + u_long rfreevnodes; + + rfreevnodes = vnlru_read_freevnodes(); + return (sysctl_handle_long(oidp, &rfreevnodes, 0, req)); +} + +SYSCTL_PROC(_vfs, OID_AUTO, freevnodes, + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_freevnodes, + "LU", "Number of \"free\" vnodes"); + static int sysctl_wantfreevnodes(SYSCTL_HANDLER_ARGS) {