mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-30 20:35:03 +01:00
Revert commit 8733bc277a
Author: Mateusz Guzik <[email protected]> Date: Thu Sep 14 16:13:01 2023 +0000 vfs: don't provoke recycling non-free vnodes without a good reason If the total number of free vnodes is at or above target, there is no point creating more of them. This commit was done as a performance optimization but ends up causing slowdowns when doing operations on many files. Requested by: re (cperciva) MFC after: 1 minute
This commit is contained in:
1 parent
46f02c4282
commit
ab05a1cf32
1 file changed
+4
-18
+4
-18
@@ -1992,25 +1992,11 @@ vn_alloc_hard(struct mount *mp, u_long rnumvnodes, bool bumped)
|
||||
|
||||
mtx_lock(&vnode_list_mtx);
|
||||
|
||||
if (vn_alloc_cyclecount != 0) {
|
||||
rnumvnodes = atomic_load_long(&numvnodes);
|
||||
if (rnumvnodes + 1 < desiredvnodes) {
|
||||
vn_alloc_cyclecount = 0;
|
||||
mtx_unlock(&vnode_list_mtx);
|
||||
goto alloc;
|
||||
}
|
||||
|
||||
rfreevnodes = vnlru_read_freevnodes();
|
||||
if (rfreevnodes < wantfreevnodes) {
|
||||
if (vn_alloc_cyclecount++ >= rfreevnodes) {
|
||||
vn_alloc_cyclecount = 0;
|
||||
vstir = true;
|
||||
}
|
||||
} else {
|
||||
vn_alloc_cyclecount = 0;
|
||||
}
|
||||
rfreevnodes = vnlru_read_freevnodes();
|
||||
if (vn_alloc_cyclecount++ >= rfreevnodes) {
|
||||
vn_alloc_cyclecount = 0;
|
||||
vstir = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Grow the vnode cache if it will not be above its target max after
|
||||
* growing. Otherwise, if there is at least one free vnode, try to
|
||||
|
||||
Reference in new issue
Block a user