Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Aug 2023 23:57:34 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 64e881f2db96 - main - vfs: track how many times vn_alloc blocked on hitting the vnode limit
Message-ID:  <202308182357.37INvYbI084004@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=64e881f2db968bf10c4aa22668ea270e1b9dd3c1

commit 64e881f2db968bf10c4aa22668ea270e1b9dd3c1
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-08-18 23:56:58 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-08-18 23:56:58 +0000

    vfs: track how many times vn_alloc blocked on hitting the vnode limit
---
 sys/kern/vfs_subr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 36bf8d80782a..0f3f00abfd4a 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1712,6 +1712,10 @@ vtryrecycle(struct vnode *vp)
  * vnlru to clear things up, but ultimately always performs a M_WAITOK allocation.
  */
 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,
+    "Number of times vnode allocation blocked waiting on vnlru");
 
 static struct vnode * __noinline
 vn_alloc_hard(struct mount *mp)
@@ -1746,6 +1750,7 @@ vn_alloc_hard(struct mount *mp)
 		 * Wait for space for a new vnode.
 		 */
 		vnlru_kick();
+		vn_alloc_sleeps++;
 		msleep(&vnlruproc_sig, &vnode_list_mtx, PVFS, "vlruwk", hz);
 		if (atomic_load_long(&numvnodes) + 1 > desiredvnodes &&
 		    vnlru_read_freevnodes() > 1)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308182357.37INvYbI084004>