Skip to content

Commit

Permalink
vfs: don't kick vnlru if it is already running
Browse files Browse the repository at this point in the history
Further shaves some lock trips.

(cherry picked from commit 76f1153)
  • Loading branch information
mjguzik committed Sep 22, 2023
1 parent 206dd9d commit 2ea531b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sys/kern/vfs_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,9 +1557,11 @@ vnlru_kick_locked(void)
}

static void
vnlru_kick(void)
vnlru_kick_cond(void)
{

if (vnlruproc_sig)
return;
mtx_lock(&vnode_list_mtx);
vnlru_kick_locked();
mtx_unlock(&vnode_list_mtx);
Expand Down Expand Up @@ -1812,7 +1814,7 @@ vn_alloc_hard(struct mount *mp)
mtx_assert(&vnode_list_mtx, MA_NOTOWNED);
rnumvnodes = atomic_fetchadd_long(&numvnodes, 1) + 1;
if (vnlru_under(rnumvnodes, vlowat))
vnlru_kick();
vnlru_kick_cond();
return (uma_zalloc_smr(vnode_zone, M_WAITOK));
}

Expand Down

0 comments on commit 2ea531b

Please sign in to comment.