Merge tag 'discard-relax-locks-6.10_2024-04-15' of https://git.kernel.org/pub/scm...
authorChandan Babu R <chandanbabu@kernel.org>
Tue, 16 Apr 2024 07:16:28 +0000 (12:46 +0530)
committerChandan Babu R <chandanbabu@kernel.org>
Tue, 16 Apr 2024 07:16:28 +0000 (12:46 +0530)
commit6ad1b91470608dbe10801a673cdfc75925878920
tree6abf41f6498f074d79b9411849a2a366b7d6758c
parent9ba8e658d867be96f9da58f060deff1e9cbca1a9
parentb0ffe661fab4b939e4472ef96b8dac3c74e0e03e
Merge tag 'discard-relax-locks-6.10_2024-04-15' of https://git./linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeA

xfs: less heavy locks during fstrim

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.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
* tag 'discard-relax-locks-6.10_2024-04-15' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: fix performance problems when fstrimming a subset of a fragmented AG