mirror of
https://github.com/opnsense/src.git
synced 2026-06-20 22:19:13 -04:00
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. Tested by: pho (in a bigger patch)
This commit is contained in:
parent
b627b3e6ea
commit
8733bc277a
1 changed files with 12 additions and 4 deletions
|
|
@ -1802,11 +1802,19 @@ vn_alloc_hard(struct mount *mp)
|
|||
mtx_unlock(&vnode_list_mtx);
|
||||
goto alloc;
|
||||
}
|
||||
rfreevnodes = vnlru_read_freevnodes();
|
||||
if (vn_alloc_cyclecount++ >= rfreevnodes) {
|
||||
vn_alloc_cyclecount = 0;
|
||||
vstir = true;
|
||||
|
||||
if (vn_alloc_cyclecount != 0) {
|
||||
rfreevnodes = vnlru_read_freevnodes();
|
||||
if (rfreevnodes < wantfreevnodes) {
|
||||
if (vn_alloc_cyclecount++ >= rfreevnodes) {
|
||||
vn_alloc_cyclecount = 0;
|
||||
vstir = true;
|
||||
}
|
||||
} else {
|
||||
vn_alloc_cyclecount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Grow the vnode cache if it will not be above its target max
|
||||
* after growing. Otherwise, if the free list is nonempty, try
|
||||
|
|
|
|||
Loading…
Reference in a new issue