From nobody Fri Oct 13 23:54:02 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 4S6jyf4Ky5z4wyQS; Fri, 13 Oct 2023 23:54:02 +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 4S6jyf3jSwz3Kg9; Fri, 13 Oct 2023 23:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697241242; 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=NHbv4xFGKbMVF8Z5OhkmONlb4ZdmwyeEYhoEaTIMaho=; b=hPAaYQfQje1tkfdifRnsdSuKbS1QraVVCw5T7yFuDoFruvsd3ACB445yENek0MZTmGx8ma sLnzPNTJHeDYbkytah/M0JW50P+QwRTdt19b5acGL5/xg/TIB6H6m9aco5WDCyk10PAA34 I/OBsd6E0l5Uzm1Q+mW8C3SYuQCrwDd6UdQPkcioEHeKPdSg0GdIKsgAWg+UnlGwsjEWL6 UTnvbtH4IeOnPK67TCU6Vn5sMb788FH7iPUGbRKC0mp9LZeP5FzqyGwbrmLNH5GNo3Kvsp 5rUUAcDg5p9YW7vEetVaI2nPealnZTQ8Z9gB0hdO53zvrmU63WGFMDJwY0FWwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697241242; a=rsa-sha256; cv=none; b=q26geYkS9nqbUGPC5g6UUkAZIa+VL/8eyXM1vpduOj9schd9314Icv+FKn0NCNX97iuVuW zMBUC5dWf3pEisYtu0owSI2ZfRBPZLPQUoFqmvvzOzt98MVTSDVbQLwifz5UJFDjEaheT7 hXBycXUQqtnE/5PHnNUYJa3F5cAqNBpKHI0ELqTVwqoSXlvD0qmdH6v72zswUolgp816cf Pj4I6epCi8znwXLRvuoYzajdHxMxlPHJMDkhaG/k7PJE+1OlmRUbBWmN2yF4CbQZ3h+Yrm wu1RFedYNgEzpB+UUVVohzWX4miIQzJ7HrzIylOtNT282RQ8toQME1mTjDPDAA== 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=1697241242; 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=NHbv4xFGKbMVF8Z5OhkmONlb4ZdmwyeEYhoEaTIMaho=; b=DvBX9UvaXktBESElf+0wV1saYsStmOCIA/rrV6t9G2kAM+q3A10y3Gmrb5G/KvsxkQ3uA0 U69RETmkIbdvnBEL5bcmsjbYHSOM7fWRCX6XmgNoQRuTzyTJoD5HOSzPARcy3Rgx2/mwKv lGo9J7kfRQDnL5UPs2hemVoYRb+r5GcWGyP7uaDtAJqTzS4srO9xuKxZ/VmhxjtGNFPoGp F/l9GkU1VYJtJfOmUrPueHlckQLrbc5q9RF/3GVbhnKr57VylHGr5a+FGcYJWOZqmdsdHx zJn1LeUEviCgEe0kNKgPcyghkPOiwrHGgRjzHtFhG4sMbSvP/3syaxJpoLNYMQ== 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 4S6jyf2q8gz17c2; Fri, 13 Oct 2023 23:54:02 +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 39DNs2WQ032599; Fri, 13 Oct 2023 23:54:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DNs2fS032596; Fri, 13 Oct 2023 23:54:02 GMT (envelope-from git) Date: Fri, 13 Oct 2023 23:54:02 GMT Message-Id: <202310132354.39DNs2fS032596@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: eb58f9e6c6df - stable/13 - vfs: convert recycles_count and recycles_free_count to mere u_long 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: eb58f9e6c6dfbd6a43277bc0253152302ac1c2a2 Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=eb58f9e6c6dfbd6a43277bc0253152302ac1c2a2 commit eb58f9e6c6dfbd6a43277bc0253152302ac1c2a2 Author: Mateusz Guzik AuthorDate: 2023-10-12 06:57:59 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-13 23:52:39 +0000 vfs: convert recycles_count and recycles_free_count to mere u_long Only vnlru ever updates them. This also removes recycles_count updates from hand-rolled debug vnode recycling via sysctl. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 37544d9768110fd67527db7f2a3f7bb6fc977582) --- sys/kern/vfs_subr.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 530afbe05b3e..3305110ed065 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -198,16 +198,19 @@ static long wantfreevnodes; static long __exclusive_cache_line freevnodes; static long freevnodes_old; -static counter_u64_t recycles_count; -SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, +static u_long recycles_count; +SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD | CTLFLAG_STATS, &recycles_count, 0, "Number of vnodes recycled to meet vnode cache targets (legacy)"); -SYSCTL_COUNTER_U64(_vfs_vnode_vnlru, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, +SYSCTL_ULONG(_vfs_vnode_vnlru, OID_AUTO, recycles, CTLFLAG_RD | CTLFLAG_STATS, + &recycles_count, 0, "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, +static u_long recycles_free_count; +SYSCTL_ULONG(_vfs, OID_AUTO, recycles_free, CTLFLAG_RD | CTLFLAG_STATS, + &recycles_free_count, 0, "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, +SYSCTL_ULONG(_vfs_vnode_vnlru, OID_AUTO, recycles_free, CTLFLAG_RD | CTLFLAG_STATS, + &recycles_free_count, 0, "Number of free vnodes recycled to meet vnode cache targets"); static counter_u64_t direct_recycles_free_count; @@ -459,7 +462,6 @@ sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) goto putvnode; } - counter_u64_add(recycles_count, 1); vgone(vp); putvnode: NDFREE(&nd, 0); @@ -492,7 +494,6 @@ sysctl_ftry_reclaim_vnode(SYSCTL_HANDLER_ARGS) if (error != 0) goto drop; - counter_u64_add(recycles_count, 1); vgone(vp); VOP_UNLOCK(vp); drop: @@ -768,8 +769,6 @@ vntblinit(void *dummy __unused) uma_prealloc(buf_trie_zone, nbuf); vnodes_created = counter_u64_alloc(M_WAITOK); - recycles_count = counter_u64_alloc(M_WAITOK); - recycles_free_count = counter_u64_alloc(M_WAITOK); direct_recycles_free_count = counter_u64_alloc(M_WAITOK); vnode_skipped_requeues = counter_u64_alloc(M_WAITOK); @@ -1272,7 +1271,7 @@ restart: vn_finished_write(mp); goto next_iter_unlocked; } - counter_u64_add(recycles_count, 1); + recycles_count++; vgonel(vp); VOP_UNLOCK(vp); vdropl_recycle(vp); @@ -1929,7 +1928,7 @@ vtryrecycle(struct vnode *vp, bool isvnlru) } if (!VN_IS_DOOMED(vp)) { if (isvnlru) - counter_u64_add(recycles_free_count, 1); + recycles_free_count++; else counter_u64_add(direct_recycles_free_count, 1); vgonel(vp);