From nobody Fri Sep 22 21:51:22 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 4RsmDp5mQcz4tTTs; Fri, 22 Sep 2023 21:51:22 +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 4RsmDp44fwz3Q2J; Fri, 22 Sep 2023 21:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695419482; 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=UsiGgDE90jNWubl88vj7igrcwDc4m7C5A4z1JDy+RuA=; b=CMqrV+oGTvYWIWR/Jc9hIG6QVNv7ZuHp/qqyvD1k20CmeqLNs3x0Fj+hQKL9MpF6ocBXzr rAn8blvGZnpHrdNf6D+OZ6P6s3yK7wQvqp2AWBjz4IbLdfWlDK4BfQ0Cyherf26Ln6RHb7 eqNrvkZlH5L7SYTKDkZv+dEP6fKYBwYSuL8ZJ5YdgjFTGMzrPbYbbI069Tpd2++Iw0jxXC LQgM+ZMvOvnYBjBydf/OdXKG8ApuvwYYlSZlcO5XHqtEv3kXvO+fLui2dVNuOquv51dlwK nNDZdSTv5gPet09hrq3ILxfGQqREOOkzeDQgABR7koQ8NeX1AqWvOoG5GI/dWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695419482; a=rsa-sha256; cv=none; b=f8IH0yoWm3wTnz6bp/wlHmOHerYqrtfnV5M28bAAIJwRbmEkjmfRaz7/Jh6yN1vM4kkIyE EZkTbIUclPkaV5sKrC2l/0FSRHvzWbdvRGSV255z2Gan3PNKMH7TSeVsuzqmK1V08sDfQm HUvdzoovoqGs6Preb9OiligHmebXoF7+MIUskio4wo5lHl2/Bn69xa/e8+tjokogiWjCba ZOFwyUnDPEIhzW8gGnPjRnK0LPzzBGWbLyx6ttDfHpmWX9Q4COvHqgMQdM0z6RPHGhZSKy Z1UkqpVAuqPJW4XEUogHKcBRBz+gUTr+mONG+IAvxIafZvU4iivWeuR4CImUNw== 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=1695419482; 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=UsiGgDE90jNWubl88vj7igrcwDc4m7C5A4z1JDy+RuA=; b=klR8VyAgIUuTCI13U36Kj1ucu4ty3ALP4HtWz8NMpQy2sSSoRdyqXcxHw/0Y0fOZKUiOHp XsZ4aH7gR8EUiRAsQkQ1f9IT7VLOspC7NYtnkISUKos2nAYm7PbHFgl/2+Ew639i5ugzqd OxDBUTWdt/cFXjNqUjo2RhtMWG+EtPtfvkG8e8ZjwvIP8rItH48DuwD9R63ManMcQRevt2 SWNwTjozyLTvKAynWIClIt25wsBhoipHpTKO+Vtr1Z2tOVyvlnpfLUqaxMNVcIsQJ3kS5m lilZe8/rjUKf75B9EfJEQAC7oo8RIdcEv8lD7qgAqTRCoUxU0KOK4ebI/qnGsA== 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 4RsmDp38vKzf3T; Fri, 22 Sep 2023 21:51:22 +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 38MLpM2M039536; Fri, 22 Sep 2023 21:51:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38MLpM1I039533; Fri, 22 Sep 2023 21:51:22 GMT (envelope-from git) Date: Fri, 22 Sep 2023 21:51:22 GMT Message-Id: <202309222151.38MLpM1I039533@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: b757ea2bb27c - stable/14 - vfs: group vnode-related sysctls under vfs.vnode 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: b757ea2bb27c4035d28009d4a9906c66301d8e3e Auto-Submitted: auto-generated The branch stable/14 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b757ea2bb27c4035d28009d4a9906c66301d8e3e commit b757ea2bb27c4035d28009d4a9906c66301d8e3e Author: Mateusz Guzik AuthorDate: 2023-09-15 21:08:38 +0000 Commit: Mateusz Guzik CommitDate: 2023-09-22 21:50:48 +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, 29 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index f4cccf2b4e1f..a8477e4b691e 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -126,6 +126,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. @@ -133,10 +142,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"); /* @@ -188,14 +201,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; @@ -345,6 +362,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"); @@ -358,6 +378,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"); @@ -382,11 +405,14 @@ 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 | CTLFLAG_STATS, +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 @@ -1755,7 +1781,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