Skip to content

Commit

Permalink
vfs: track how many times vn_alloc blocked on hitting the vnode limit
Browse files Browse the repository at this point in the history
  • Loading branch information
mjguzik committed Aug 18, 2023
1 parent 57a3b81 commit 64e881f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sys/kern/vfs_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,10 @@ vtryrecycle(struct vnode *vp)
* vnlru to clear things up, but ultimately always performs a M_WAITOK allocation.
*/
static u_long vn_alloc_cyclecount;
static u_long vn_alloc_sleeps;

SYSCTL_ULONG(_vfs, OID_AUTO, vnode_alloc_sleeps, CTLFLAG_RD, &vn_alloc_sleeps, 0,
"Number of times vnode allocation blocked waiting on vnlru");

static struct vnode * __noinline
vn_alloc_hard(struct mount *mp)
Expand Down Expand Up @@ -1746,6 +1750,7 @@ vn_alloc_hard(struct mount *mp)
* Wait for space for a new vnode.
*/
vnlru_kick();
vn_alloc_sleeps++;
msleep(&vnlruproc_sig, &vnode_list_mtx, PVFS, "vlruwk", hz);
if (atomic_load_long(&numvnodes) + 1 > desiredvnodes &&
vnlru_read_freevnodes() > 1)
Expand Down

0 comments on commit 64e881f

Please sign in to comment.