git: 9080190b970c - main - vfs: count how many times vnlru got woken up due to vnode shortage

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Sat, 16 Sep 2023 17:28:08 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=9080190b970c7026695571f90b95fdcf7056ec67

commit 9080190b970c7026695571f90b95fdcf7056ec67
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-09-16 17:26:39 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-09-16 17:26:39 +0000

    vfs: count how many times vnlru got woken up due to vnode shortage
---
 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 11cdea5a7dc1..0251525a50c7 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1477,6 +1477,10 @@ vnlru_recalc(void)
  */
 static struct proc *vnlruproc;
 static int vnlruproc_sig;
+static u_long vnlruproc_kicks;
+
+SYSCTL_ULONG(_vfs_vnode_vnlru, OID_AUTO, kicks, CTLFLAG_RD, &vnlruproc_kicks, 0,
+    "Number of times vnlru got woken up due to vnode shortage");
 
 /*
  * The main freevnodes counter is only updated when a counter local to CPU
@@ -1571,6 +1575,7 @@ vnlru_kick_locked(void)
 	mtx_assert(&vnode_list_mtx, MA_OWNED);
 	if (vnlruproc_sig == 0) {
 		vnlruproc_sig = 1;
+		vnlruproc_kicks++;
 		wakeup(vnlruproc);
 	}
 }