mbox series

[PATCHSET,v25.0,0/4] xfs: relax AGF locks during fstrim

Message ID 168506069715.3738451.3754446921976634655.stgit@frogsfrogsfrogs (mailing list archive)
Headers show
Series xfs: relax AGF locks during fstrim | expand

Message

Darrick J. Wong May 26, 2023, 12:37 a.m. UTC
Hi all,

Congratulations!  You have made it to the final patchset of the main
online fsck feature!  This patchset fixes some stalling behavior that I
observed when running FITRIM against large flash-based filesystems with
very heavily fragmented free space data.  In summary -- the current
fstrim implementation optimizes for trimming the largest free extents
first, and holds the AGF lock for the duration of the operation.  This
is great if fstrim is being run as a foreground process by a sysadmin.

For xfs_scrub, however, this isn't so good -- we don't really want to
block on one huge kernel call while reporting no progress information.
We don't want to hold the AGF so long that background processes stall.
These problems are easily fixable by issuing smaller FITRIM calls, but
there's still the problem of walking the entire cntbt.  To solve that
second problem, we introduce a new sub-AG FITRIM implementation.  To
solve the first problem, make it relax the AGF periodically.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=discard-relax-locks
---
 fs/xfs/xfs_discard.c |  262 ++++++++++++++++++++++++++++++++++++++++++--------
 fs/xfs/xfs_trace.h   |    1 
 2 files changed, 222 insertions(+), 41 deletions(-)