git: 2ea531b264df - stable/14 - vfs: don't kick vnlru if it is already running
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 22 Sep 2023 21:51:15 UTC
The branch stable/14 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2ea531b264df97bfea7d74c7f9414b2d3c5d4277 commit 2ea531b264df97bfea7d74c7f9414b2d3c5d4277 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2023-09-14 16:27:47 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2023-09-22 21:50:46 +0000 vfs: don't kick vnlru if it is already running Further shaves some lock trips. (cherry picked from commit 76f1153790b6d2e1a4f0389c3ac24e41d08f9ba6) --- sys/kern/vfs_subr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 80ec15f78028..4c9cb6200f10 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -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); @@ -1812,7 +1814,7 @@ alloc: 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)); }