git: a0fb0a72b15c - stable/13 - vfs: add max_vnlru_free to the vfs.vnode.vnlru tree

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Fri, 13 Oct 2023 23:53:58 UTC
The branch stable/13 has been updated by mjg:

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

commit a0fb0a72b15cc6cf36b402d35f5b63680e2ab282
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-10-11 13:05:43 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-10-13 23:48:14 +0000

    vfs: add max_vnlru_free to the vfs.vnode.vnlru tree
    
    While here rename the var internally.
    
    (cherry picked from commit 281a9715b582861fe4097c2f27eb27b208d752b1)
---
 sys/kern/vfs_subr.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 8c831034a8e5..a8e4714a7a79 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1296,9 +1296,11 @@ next_iter:
 	return (done);
 }
 
-static int max_vnlru_free = 10000; /* limit on vnode free requests per call */
-SYSCTL_INT(_debug, OID_AUTO, max_vnlru_free, CTLFLAG_RW, &max_vnlru_free,
-    0,
+static int max_free_per_call = 10000;
+SYSCTL_INT(_debug, OID_AUTO, max_vnlru_free, CTLFLAG_RW, &max_free_per_call, 0,
+    "limit on vnode free requests per call to the vnlru_free routine (legacy)");
+SYSCTL_INT(_vfs_vnode_vnlru, OID_AUTO, max_free_per_call, CTLFLAG_RW,
+    &max_free_per_call, 0,
     "limit on vnode free requests per call to the vnlru_free routine");
 
 /*
@@ -1313,8 +1315,8 @@ vnlru_free_impl(int count, struct vfsops *mnt_op, struct vnode *mvp)
 	bool retried;
 
 	mtx_assert(&vnode_list_mtx, MA_OWNED);
-	if (count > max_vnlru_free)
-		count = max_vnlru_free;
+	if (count > max_free_per_call)
+		count = max_free_per_call;
 	if (count == 0) {
 		mtx_unlock(&vnode_list_mtx);
 		return (0);