From nobody Wed Oct 04 12:08:56 2023 X-Original-To: dev-commits-src-branches@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 4S0tlD3KJwz4vp6R; Wed, 4 Oct 2023 12:08: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 4S0tlD24KFz3JD3; Wed, 4 Oct 2023 12:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696421336; 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=bUcN/kKWa+sMgQ3uxU+34oWS5fL0naiXyAlxWADfJGI=; b=Vl3vh8tDlELpuOMhrZ0JUTyf1qAUeKxh6J1LwYk5VD6wEG8uikVQdzTRgd41Ur4vOzp4H+ 8pJP43DMaMyZs3v/JO+puP8Ydc6mgVTew+7+7L05ADLlCQ+BrmYlUlb3dlLohRh72W5LTt 9zJ9/Z9opaYTm6ugrE+4ZkbZsFCRn3d03dbWI/ePEL2z4JsG207HnI7huhglV5hsYXmjX8 COUy3dIYIufxil0o5AIbLNOyDhtSDEE7u/bxM0SAeTb3DVNP3YpGTQHhanSfZM8lFrlmkS n09Cq+6V4WvX1Jixo6EFVdRcuQ/Qsy/CfWSo4Cu9+wesqDgrTxIZ+Gi75+VfZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696421336; a=rsa-sha256; cv=none; b=CB1Kx1/M/mM+WWAGZ3U3ftubqxEdMHVgKG67lPj/DsSZDBCTG5bpgGzv0FxRNsBoaLlmEV yROvkKKepva/CKXOvpNXnvAetjUjUWQkdUsyvYl2ycIri1SymyKj1PUuNEV9VmI4wEKzjl 1ilecbfDBnknvB9fYs91UIIXyCb5qM3BMFdzrD0Vhhzq4B6AgFCdmOT1qwszoY4afGQHex ELvES3P8baDhtOHV8BX0NGgQ6i7UY2bKkkTu1waPPreF8JZx07QzB+eRy4+l2nmOlcoOWs L/KAZTEEe8a690uuljbZsHUmLSd1cxhjAGHDtlZxDMoIoz5m2MhLWeYgXP/UmQ== 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=1696421336; 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=bUcN/kKWa+sMgQ3uxU+34oWS5fL0naiXyAlxWADfJGI=; b=nwhOGBzqGxazR91iOeOFECOdOxNll75WwIpbxWvd0VOsNLK1qMD7EprOBj0tLKwD0L3e+j qThm0Z+234aQCgS492H/OFPHZ2m6JNbn57kFEQIEnjh9+WRYO9DI3+mR4tjBfu1Hv7MNRr xws7V7NQ2nIBW9yKpdIvdHvlivOTziXo3YSIbv90Fh9EueCQTuKtl5u0xk6yRH2kL5zIxs dL5c9dzD78mh/DKaqbPjfckojUusb1czKjtTa/XzHharE76xVK2WgG8SwPjafmkVykLg5a kbyYBu/qe0hmlEaR1zI/vBMiNDjhqelcKbGCujrMY0/qRJzhdwlIv43nmnSYtA== 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 4S0tlD1BNzzcgV; Wed, 4 Oct 2023 12:08: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 394C8uRM053408; Wed, 4 Oct 2023 12:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 394C8uGP053405; Wed, 4 Oct 2023 12:08:56 GMT (envelope-from git) Date: Wed, 4 Oct 2023 12:08:56 GMT Message-Id: <202310041208.394C8uGP053405@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: 77a8bd148796 - stable/13 - vfs: group vnode-related sysctls under vfs.vnode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 77a8bd1487966357dcb16cc27bbf269d9922e5a2 Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=77a8bd1487966357dcb16cc27bbf269d9922e5a2 commit 77a8bd1487966357dcb16cc27bbf269d9922e5a2 Author: Mateusz Guzik AuthorDate: 2023-09-15 21:08:38 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-04 12:05:56 +0000 vfs: group vnode-related sysctls under vfs.vnode Instead of having things scattered through vfs, debug and kern trees. Old names remain for compatibility. Sample output of "sysctl vfs.vnode": vfs.vnode.vnlru.failed_runs: 0 vfs.vnode.vnlru.recycles_free: 0 vfs.vnode.vnlru.recycles: 0 vfs.vnode.stats.alloc_sleeps: 0 vfs.vnode.stats.free: 1310 vfs.vnode.stats.skipped_requeues: 0 vfs.vnode.stats.created: 1686 vfs.vnode.stats.count: 1641 vfs.vnode.param.wantfree: 2097152 vfs.vnode.param.limit: 8388608 (cherry picked from commit d3e6478912431309aad36211b6c39b0d741312dc) --- sys/kern/vfs_subr.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c41798c56e18..8c8f69c88726 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -125,6 +125,15 @@ static int v_inval_buf_range_locked(struct vnode *vp, struct bufobj *bo, daddr_t startlbn, daddr_t endlbn); static void vnlru_recalc(void); +static SYSCTL_NODE(_vfs, OID_AUTO, vnode, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "vnode configuration and statistics"); +static SYSCTL_NODE(_vfs_vnode, OID_AUTO, param, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "vnode configuration"); +static SYSCTL_NODE(_vfs_vnode, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "vnode statistics"); +static SYSCTL_NODE(_vfs_vnode, OID_AUTO, vnlru, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "vnode recycling"); + /* * Number of vnodes in existence. Increased whenever getnewvnode() * allocates a new vnode, decreased in vdropl() for VIRF_DOOMED vnode. @@ -132,10 +141,14 @@ static void vnlru_recalc(void); static u_long __exclusive_cache_line numvnodes; SYSCTL_ULONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, + "Number of vnodes in existence (legacy)"); +SYSCTL_ULONG(_vfs_vnode_stats, OID_AUTO, count, CTLFLAG_RD, &numvnodes, 0, "Number of vnodes in existence"); static counter_u64_t vnodes_created; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created, + "Number of vnodes created by getnewvnode (legacy)"); +SYSCTL_COUNTER_U64(_vfs_vnode_stats, OID_AUTO, created, CTLFLAG_RD, &vnodes_created, "Number of vnodes created by getnewvnode"); /* @@ -187,14 +200,18 @@ static long freevnodes_old; static counter_u64_t recycles_count; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, + "Number of vnodes recycled to meet vnode cache targets (legacy)"); +SYSCTL_COUNTER_U64(_vfs_vnode_vnlru, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, "Number of vnodes recycled to meet vnode cache targets"); static counter_u64_t recycles_free_count; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles_free, CTLFLAG_RD, &recycles_free_count, + "Number of free vnodes recycled to meet vnode cache targets (legacy)"); +SYSCTL_COUNTER_U64(_vfs_vnode_vnlru, OID_AUTO, recycles_free, CTLFLAG_RD, &recycles_free_count, "Number of free vnodes recycled to meet vnode cache targets"); static counter_u64_t vnode_skipped_requeues; -SYSCTL_COUNTER_U64(_vfs, OID_AUTO, vnode_skipped_requeues, CTLFLAG_RD, &vnode_skipped_requeues, +SYSCTL_COUNTER_U64(_vfs_vnode_stats, OID_AUTO, skipped_requeues, CTLFLAG_RD, &vnode_skipped_requeues, "Number of times LRU requeue was skipped due to lock contention"); static u_long deferred_inact; @@ -344,6 +361,9 @@ sysctl_maxvnodes(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_maxvnodes, + "LU", "Target for maximum number of vnodes (legacy)"); +SYSCTL_PROC(_vfs_vnode_param, OID_AUTO, limit, CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_maxvnodes, "LU", "Target for maximum number of vnodes"); @@ -357,6 +377,9 @@ sysctl_freevnodes(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_vfs, OID_AUTO, freevnodes, + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_freevnodes, + "LU", "Number of \"free\" vnodes (legacy)"); +SYSCTL_PROC(_vfs_vnode_stats, OID_AUTO, free, CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_freevnodes, "LU", "Number of \"free\" vnodes"); @@ -381,12 +404,17 @@ sysctl_wantfreevnodes(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_vfs, OID_AUTO, wantfreevnodes, + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_wantfreevnodes, + "LU", "Target for minimum number of \"free\" vnodes (legacy)"); +SYSCTL_PROC(_vfs_vnode_param, OID_AUTO, wantfree, CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_wantfreevnodes, "LU", "Target for minimum number of \"free\" vnodes"); static int vnlru_nowhere; SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, &vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); +SYSCTL_INT(_vfs_vnode_vnlru, OID_AUTO, failed_runs, CTLFLAG_RD | CTLFLAG_STATS, + &vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); static int sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) @@ -1771,7 +1799,7 @@ vtryrecycle(struct vnode *vp) static u_long vn_alloc_cyclecount; static u_long vn_alloc_sleeps; -SYSCTL_ULONG(_vfs, OID_AUTO, vnode_alloc_sleeps, CTLFLAG_RD, &vn_alloc_sleeps, 0, +SYSCTL_ULONG(_vfs_vnode_stats, OID_AUTO, alloc_sleeps, CTLFLAG_RD, &vn_alloc_sleeps, 0, "Number of times vnode allocation blocked waiting on vnlru"); static struct vnode * __noinline