#
780666c0 |
| 06-Jun-2024 |
Ryan Libby <rlibby@FreeBSD.org> |
getblk: reduce time under bufobj lock
Use the new pctrie combined insert/lookup facility to reduce work and time under the bufobj interlock when associating a buf with a vnode.
We now do one lookup
getblk: reduce time under bufobj lock
Use the new pctrie combined insert/lookup facility to reduce work and time under the bufobj interlock when associating a buf with a vnode.
We now do one lookup in the dirty tree and one combined lookup/insert in the clean tree instead of one lookup in dirty, two in clean, and then an insert in clean. We also avoid touching the possibly unrelated buf at the tail of the queue.
Also correct an issue where the actual order of the tail queue depended on the insertion order due to sign issues.
Reviewed by: kib (previous version), dougm, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D45395
show more ...
|
#
9530182e |
| 26-Dec-2023 |
Jason A. Harmening <jah@FreeBSD.org> |
VFS: update VOP_FSYNC() debug check to reflect actual locking policy
Shared vs. exclusive locking is determined not by MNT_EXTENDED_SHARED but by MNT_SHARED_WRITES (although there are several places
VFS: update VOP_FSYNC() debug check to reflect actual locking policy
Shared vs. exclusive locking is determined not by MNT_EXTENDED_SHARED but by MNT_SHARED_WRITES (although there are several places that ignore this and simply always use an exclusive lock). Also add a comment on the possible difference between VOP_GETWRITEMOUNT(vp) and vp->v_mount on this path.
Found by local testing of unionfs atop ZFS with DEBUG_VFS_LOCKS.
MFC after: 2 weeks Reviewed by: kib, olce Differential Revision: https://reviews.freebsd.org/D43816
show more ...
|
#
b068bb09 |
| 08-Jan-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
Add vnode_pager_clean_{a,}sync(9)
Bump __FreeBSD_version for ZFS use.
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D4
Add vnode_pager_clean_{a,}sync(9)
Bump __FreeBSD_version for ZFS use.
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43356
show more ...
|
#
2d33ad48 |
| 31-Dec-2023 |
Konstantin Belousov <kib@FreeBSD.org> |
vtruncbuf: improve the check for meta buffer
Revision e99215a614675 reorganized the code in vtruncbuf(), and moved the logic to flush meta buffers into a dedicated loop. While doing it, the conditio
vtruncbuf: improve the check for meta buffer
Revision e99215a614675 reorganized the code in vtruncbuf(), and moved the logic to flush meta buffers into a dedicated loop. While doing it, the condition was changed from bp->b_lblkno < 0 (to handle) into bp->b_lblkno > 0 (to skip), which causes buffer at lblkno to needlessly flush.
Reviewed by: chs, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43261
show more ...
|
#
4c41d10f |
| 31-Dec-2023 |
Konstantin Belousov <kib@FreeBSD.org> |
vtruncbuf: add a comment explaining the purpose of the loop
Reviewed by: chs, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43261
|
#
27f4eda3 |
| 04-Jan-2024 |
Mark Johnston <markj@FreeBSD.org> |
vfs: Simplify vrefact()
refcount_acquire() returns the old value, just use that. No functional change intended.
Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.or
vfs: Simplify vrefact()
refcount_acquire() returns the old value, just use that. No functional change intended.
Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43255
show more ...
|
#
29363fb4 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
#
0c5cd045 |
| 01-Nov-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: remove majority of stale commentary about free list
There is no "free list" for a long time now.
While here slightly tidy up affected comments in other ways.
Note that the "free vnode" term i
vfs: remove majority of stale commentary about free list
There is no "free list" for a long time now.
While here slightly tidy up affected comments in other ways.
Note that the "free vnode" term is a misnomer at best and will also need to get sorted out.
show more ...
|
#
3943698c |
| 20-Oct-2023 |
Kirk McKusick <mckusick@FreeBSD.org> |
Minor sysctl description cleanup.
No functional change.
Agreed-by: Mateusz Guzik
|
#
37544d97 |
| 12-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: convert recycles_count and recycles_free_count to mere u_long
Only vnlru ever updates them.
This also removes recycles_count updates from hand-rolled debug vnode recycling via sysctl.
Sponsor
vfs: convert recycles_count and recycles_free_count to mere u_long
Only vnlru ever updates them.
This also removes recycles_count updates from hand-rolled debug vnode recycling via sysctl.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
a92fc312 |
| 12-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: count recycles by vnlru and by vn_alloc separately
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
bb679b0c |
| 11-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: count calls to uma_reclaim in vnlru
|
#
281a9715 |
| 11-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: add max_vnlru_free to the vfs.vnode.vnlru tree
While here rename the var internally.
|
#
054f45e0 |
| 11-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: further speed up continuous free vnode recycle
The primary bottleneck *was* vnode_list mtx, which got artificially worsened due to the following work done with the lock held: 1. the global heav
vfs: further speed up continuous free vnode recycle
The primary bottleneck *was* vnode_list mtx, which got artificially worsened due to the following work done with the lock held: 1. the global heavily modified numvnodes counter was being read, inducing massive cache line ping pong 2. should the value fit limits (which it normally did) there would be an avoidable write to vn_alloc_cyclecount, which is being read outside of the lock, once more inducing traffic
But if vn_alloc_cyclecount is 0, which it normally is even when facing vnode shortage, there is no need to check numvnodes nor set it to 0 again.
Another problem was numvnodes adjustment (which made the locked read much worse). While it fundamentally does not scale as it is not distributed in any fashion, it was avoidably slow. When bumping over the vnode limit, it would be modified with atomics 3 times: inc + dec to backpedal in vn_alloc, then final inc in vn_alloc_hard.
One can let some slop persist over calls to vnlru_free instead.
In principle each thread in the system could get here and bump it, so a limit is put in place to keep things sane.
Bench setup same as in prior commits: zfs, 20 separate directory trees each with 1 million files in total and 20 find(1) processes stating them in parallel (one per each tree).
Total run time (in seconds) goes down as follows: vnode limit 8388608 400000 before ~20 ~35 after ~8 ~15
With this in place the primary bottleneck is now ZFS.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
a4f753e8 |
| 11-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: don't recycle transiently excess vnodes
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
90a008e9 |
| 14-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: prefix regular vnlru with a special case for free vnodes
Works around severe performance problems in certain corner cases, see the commentary added.
Modifying vnlru logic has proven rather err
vfs: prefix regular vnlru with a special case for free vnodes
Works around severe performance problems in certain corner cases, see the commentary added.
Modifying vnlru logic has proven rather error prone in the past and a release is near, thus take the easy way out and fix it without having to dig into the current machinery.
show more ...
|
#
23ef25d2 |
| 10-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: consult freevnodes in vnlru_kick_cond
If the count is high enough there is no point trying to produce more. Not going there reduces traffic on the vnode_list mtx.
This further shaves total rea
vfs: consult freevnodes in vnlru_kick_cond
If the count is high enough there is no point trying to produce more. Not going there reduces traffic on the vnode_list mtx.
This further shaves total real time in a test mentioned in: 74be676d87745eb7 ("vfs: drop one vnode list lock trip during vnlru free recycle") -- 20 instances of find each creating 1 million vnodes, while total limit is set to 400k.
Time goes down from ~41 to ~35 seconds.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
1bf55a73 |
| 10-Oct-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: be less eager to call uma_reclaim(UMA_RECLAIM_DRAIN)
In face of vnode shortage the count very easily can go few units above the limit before going back down.
Calling uma_reclaim results in mas
vfs: be less eager to call uma_reclaim(UMA_RECLAIM_DRAIN)
In face of vnode shortage the count very easily can go few units above the limit before going back down.
Calling uma_reclaim results in massive amount of work which in this case is not warranted.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
8733bc27 |
| 14-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
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 pat
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)
show more ...
|
#
9080190b |
| 16-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: count how many times vnlru got woken up due to vnode shortage
|
#
ef89b78b |
| 16-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: stabilize freevnodes_old
In face of parallel callers.
|
#
509d843a |
| 16-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: s/u_long vstir/bool vstir/
|
#
d3e64789 |
| 15-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: group vnode-related sysctls under vfs.vnode
Instead of having things scattered through vfs, debug and kern trees.
Old names remain for compatibility.
Sample output of "sysctl vfs.vnode": vfs.
vfs: group vnode-related sysctls under vfs.vnode
Instead of having things scattered through vfs, debug and kern trees.
Old names remain for compatibility.
Sample output of "sysctl vfs.vnode": vfs.vnode.vnlru.failed_runs: 0 vfs.vnode.vnlru.recycles_free: 0 vfs.vnode.vnlru.recycles: 0 vfs.vnode.stats.alloc_sleeps: 0 vfs.vnode.stats.free: 1310 vfs.vnode.stats.skipped_requeues: 0 vfs.vnode.stats.created: 1686 vfs.vnode.stats.count: 1641 vfs.vnode.param.wantfree: 2097152 vfs.vnode.param.limit: 8388608
show more ...
|
#
2a689cad |
| 16-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: retire kern.minvnodes
It was marked as legacy in 2005.
|
#
03bfee17 |
| 14-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: use vnlru_read_freevnodes for the freevnodes sysctl
For a more accurate result.
|