Skip to content

btrfs: zoned: activate new BG only from extent allocation context

Naohiro Aota linux-btrfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesIn review
  2. v12 patches 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: return allocated block group from do_chunk_alloc()fs/btrfs/block-group.c+13 -30 replies
2/2btrfs: zoned: activate block group only for extent allocationfs/btrfs/block-group.c fs/btrfs/block-group.h fs/btrfs/extent-tree.c+18 -91 reply

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohannes Thumshirn
SeriesR-b T-b
1/2
2/2

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

Read the v2 thread

Cover letter [PATCH v2 0/2] btrfs: zoned: activate new BG only from extent allocation context

In btrfs_make_block_group(), we activate the allocated block group, expecting that the block group is soon used for the extent allocation.

With a lot of IOs, btrfs_async_reclaim_data_space() tries to prepare for them by pre-allocating data block groups. That preallocation can consume all the active zone counting. It is OK if they are soon written and filled. However, that's not the case. As a result, an allocation of non-data block groups fails due to the lack of an active zone resource.

This series fixes the issue by activating a new block group only when it's called from find_free_extent(). This series introduces CHUNK_ALLOC_FORCE_FOR_EXTENT in btrfs_chunk_alloc_enum to distinguish the context.

--
Changes
- v2
- Fix a flipped condition

Naohiro Aota (2):
btrfs: return allocated block group from do_chunk_alloc()
btrfs: zoned: activate block group only for extent allocation

 fs/btrfs/block-group.c | 36 +++++++++++++++++++++++++++---------
 fs/btrfs/block-group.h |  1 +
 fs/btrfs/extent-tree.c |  2 +-
 3 files changed, 29 insertions(+), 10 deletions(-)
Signature · 1 line
2.35.1