From c92fe112a763c91a13ffb5310f66afc54c1df5d8 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 7 Jan 2020 15:42:01 +0000 Subject: [PATCH] vfs: use a dedicated counter for free vnode recycling Otherwise vlrureclaim activitity is mixed in and it is hard to tell which vnodes got reclaimed. --- sys/kern/vfs_subr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c25742a21364..6cb5e9d024fa 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -204,6 +204,10 @@ static counter_u64_t recycles_count; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, "Number of vnodes recycled to meet vnode cache targets"); +static counter_u64_t recycles_free_count; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles_free, CTLFLAG_RD, &recycles_free_count, + "Number of free vnodes recycled to meet vnode cache targets"); + /* * Various variables used for debugging the new implementation of * reassignbuf(). @@ -603,6 +607,7 @@ vntblinit(void *dummy __unused) vnodes_created = counter_u64_alloc(M_WAITOK); recycles_count = counter_u64_alloc(M_WAITOK); + recycles_free_count = counter_u64_alloc(M_WAITOK); free_owe_inact = counter_u64_alloc(M_WAITOK); /* @@ -1466,7 +1471,7 @@ vtryrecycle(struct vnode *vp) return (EBUSY); } if (!VN_IS_DOOMED(vp)) { - counter_u64_add(recycles_count, 1); + counter_u64_add(recycles_free_count, 1); vgonel(vp); } VOP_UNLOCK(vp);