From nobody Sat Oct 14 01:09:00 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 4S6ld91G34z4x4FJ; Sat, 14 Oct 2023 01:09:01 +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 4S6ld90NFvz3YL2; Sat, 14 Oct 2023 01:09:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697245741; 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=nOdqa0m2DAgKKE7jW9gunrhxsx2sbgQUfs1AdMlCOd4=; b=qNak5mZt8Dvjc6Wr7OusoiHS65OFhF9fTy37Qn35rDCyg/aatNpiX/i7lgXlvGc+gbluLJ jE5FtJwnxMcLTsA256gqE026TvW5B4ix9B9+Tzcssu16UDIGHkVcTJGHLwOonAz0N4aYqG 92DyU5r4YHyKLNY7lHO9XFKWOn6gUselLLixjy6j3QNbhMDisiBSXvw1jkm70pSxVKCOM7 rJgDY8KGhz6aFywfUxe03HA/x6ftSHxr+3ZYWzRmWTh3vwDyohG8UUBVFBTkgHANPGLP4+ 3C+dM85vtW2/UvXM3ZH4HKPfhx+MAhfXdUtehPFwVsnlc5LVI/r7KEJA4CEKrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697245741; a=rsa-sha256; cv=none; b=jsWMnPa93T7bG5sWuyl5SmKCw+C3ZtOdBeUpM8pivXdM9ip9FyHhtlrVp/ri6yMLNUbeSI hYQxR/cNX6AgiIjZiwAYxXgXYl38KGwfctlqmyZbHh1U0TuUVWOuD9uSqzkzHWK0ckGLiQ noAecEQNSRwUrPjgY461VJZEWjljyYB3Kd1+OySWVxML6wB29jv2J3ME/zwU9Vmx5c7GDh xzxbnHQrb4rAsV5eGSpoMuKt6ptmYlsmprsTeGVrAyiW6aRiN6Gx3keatt9RWT9kBLXnHz y/xaR996XTEJ8nbRKbbKIebu/xYMifZCs7FCHVIBRbjarnxYhro+N4UmaA2bIQ== 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=1697245741; 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=nOdqa0m2DAgKKE7jW9gunrhxsx2sbgQUfs1AdMlCOd4=; b=dH7CN9EnnB9uzCYSoDjZp3YgPnsDkSeDYCXZnZk6gjVcC3nHfTaLQTZOJalsuiD48OwRKa i7UkIjRbMbk0n9uPAesiRaTSkGreia1YNiLdQxAU68QJOuwB2NvI9bO20d3m6snratTczL yh5dbJ3yaR0TmC49cXxZ3lMORajvP06g9e/0IpxGUNJdEIVq+9WW+lUfd/mI5jCiU/FecY OHOIsmjEIaqjKzTCpc7/AEY/vSamdGQ5hmAWUXQ4aB80MxoAi0/HFj2bvfxF7l3FLhjUS/ 3TU0IRjs4uo9YxXeJnmtczz2XdjZE+qk2aFu+X+9RGXdzlXoyP1QrJFHHpHTVA== 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 4S6ld86Kysz18ZK; Sat, 14 Oct 2023 01:09:00 +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 39E1901K052760; Sat, 14 Oct 2023 01:09:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39E190YL052757; Sat, 14 Oct 2023 01:09:00 GMT (envelope-from git) Date: Sat, 14 Oct 2023 01:09:00 GMT Message-Id: <202310140109.39E190YL052757@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: c79af90ce42f - releng/14.0 - 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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: c79af90ce42f2cea823c6ab052726393c709b89a Auto-Submitted: auto-generated The branch releng/14.0 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c79af90ce42f2cea823c6ab052726393c709b89a commit c79af90ce42f2cea823c6ab052726393c709b89a Author: Mateusz Guzik AuthorDate: 2023-10-12 06:57:59 +0000 Commit: Mateusz Guzik CommitDate: 2023-10-14 01:08:23 +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) (cherry picked from commit bdd19ce53c07bc44b9d8f46dcedda0fceca8e069) Approved by: re (gjb) --- 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 b14793ccd84e..0fe2bc46446c 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -199,16 +199,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; @@ -458,7 +461,6 @@ sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) goto putvnode; } - counter_u64_add(recycles_count, 1); vgone(vp); putvnode: vput(vp); @@ -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: @@ -774,8 +775,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); @@ -1282,7 +1281,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); @@ -1911,7 +1910,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);