Skip to content

xfs: fix a couple sparse chunk alloc problems

Brian Foster linux-xfs 5 versions – Applied

Status from this message: Applied to for-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 1 replyApplied
  2. v44 patches 5 repliesSuperseded
  3. v34 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches13 repliesSuperseded
v12 patches7 repliesSuperseded

Changes in v5 from the cover letter

- Renamed params to xfs_alloc_longest_free_extent().
v4: https://lore.kernel.org/linux-xfs/[email protected]/
- Rebased to for-next and collected review tags.
v3: https://lore.kernel.org/linux-xfs/[email protected]/
- Added patch 3 to refactor xfs_alloc_min_freelist() and calculate min/max.
- Updated patch 4 to use the max value for space available and longest extent checks.
v2: https://lore.kernel.org/linux-xfs/[email protected]/
- Reworked fix logic into allocator instead of sparse inode alloc specific.
- Dropped Fixes: tag since this is no longer directly correlated to sparse inodes.
v1: https://lore.kernel.org/linux-xfs/[email protected]/

[1] https://lore.kernel.org/linux-xfs/[email protected]/

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/4xfs: set minleft correctly for sparse chunk errortag allocationfs/xfs/libxfs/xfs_ialloc.c+4 -60 replies
2/4xfs: support additional levels in the agfl minimum calculationfs/xfs/libxfs/xfs_alloc.c+23 -80 replies
3/4xfs: calculate AGFL max to support multiple-alloc transactionsfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_bmap.c +1 more+30 -180 replies
4/4xfs: incorporate increased AGFL min requirement for minleft allocsfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_bmap.c+47 -200 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchMark TinguelyDarrick J. Wong
1/4R-b R-b
2/4R-b R-b
3/4R-b R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/4] xfs: fix a couple sparse chunk alloc problems

Hi all,

Here's v5 of the series to fix the sparse chunk alloc shutdown. The original report is available here[1].

This is mostly a convenience repost of v4 with a variable rename in patch 4.

As a brief overview, the idea here is to rework the freelist calculation helper to calculate a min and a max. The min is the historical min AGFL requirement for the current allocation. The max is an optional value for minleft allocations that perform at least one more allocation in the same transaction and thus are susceptible to seeing the min AGFL requirement increase due to level increases in the first allocation. The specific fix is to carry the delta between the max and min into minleft for such allocations so they are either guaranteed for a given AG or fail gracefully before dirtying the transaction.

Thoughts, reviews, flames appreciated.

Brian

v5:
- Renamed params to xfs_alloc_longest_free_extent().
v4: https://lore.kernel.org/linux-xfs/[email protected]/
- Rebased to for-next and collected review tags.
v3: https://lore.kernel.org/linux-xfs/[email protected]/
- Added patch 3 to refactor xfs_alloc_min_freelist() and calculate min/max.
- Updated patch 4 to use the max value for space available and longest extent checks.
v2: https://lore.kernel.org/linux-xfs/[email protected]/
- Reworked fix logic into allocator instead of sparse inode alloc specific.
- Dropped Fixes: tag since this is no longer directly correlated to sparse inodes.
v1: https://lore.kernel.org/linux-xfs/[email protected]/

[1] https://lore.kernel.org/linux-xfs/[email protected]/

Brian Foster (4):
xfs: set minleft correctly for sparse chunk errortag allocation
xfs: support additional levels in the agfl minimum calculation
xfs: calculate AGFL max to support multiple-alloc transactions
xfs: incorporate increased AGFL min requirement for minleft allocs

 fs/xfs/libxfs/xfs_alloc.c  | 106 +++++++++++++++++++++++++++----------
 fs/xfs/libxfs/xfs_alloc.h  |   7 +--
 fs/xfs/libxfs/xfs_bmap.c   |   7 ++-
 fs/xfs/libxfs/xfs_ialloc.c |  14 ++---
 4 files changed, 93 insertions(+), 41 deletions(-)
Signature · 1 line
2.55.0