git: e5114cc203a6 - stable/14 - vfs: count how many times vnlru got woken up due to vnode shortage

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Fri, 22 Sep 2023 21:51:25 UTC
The branch stable/14 has been updated by mjg:

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

commit e5114cc203a6bef23b072d9f98f6b8501e4ce6d9
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-09-16 17:26:39 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-09-22 21:50:48 +0000

    vfs: count how many times vnlru got woken up due to vnode shortage
    
    (cherry picked from commit 9080190b970c7026695571f90b95fdcf7056ec67)
---
 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);
 	}
 }