git: 3e8f649ec351 - releng/14.0 - vfs: don't kick vnlru if it is already running
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 24 Sep 2023 21:46:51 UTC
The branch releng/14.0 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3e8f649ec3516a5506bbd3fd95051448e3b1b6d5 commit 3e8f649ec3516a5506bbd3fd95051448e3b1b6d5 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2023-09-14 16:27:47 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2023-09-24 21:45:41 +0000 vfs: don't kick vnlru if it is already running Further shaves some lock trips. Approved by: re (gjb) (cherry picked from commit 76f1153790b6d2e1a4f0389c3ac24e41d08f9ba6) (cherry picked from commit 2ea531b264df97bfea7d74c7f9414b2d3c5d4277) --- 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)); }