git: ba4d4882ce72 - releng/14.0 - vfs: count how many times vnlru got woken up due to vnode shortage

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Sun, 24 Sep 2023 21:47:01 UTC
The branch releng/14.0 has been updated by mjg:

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

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

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