All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] btrfs: zoned: activate new BG only from extent allocation context
@ 2022-03-22  9:11 Naohiro Aota
  2022-03-22  9:11 ` [PATCH v2 1/2] btrfs: return allocated block group from do_chunk_alloc() Naohiro Aota
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Naohiro Aota @ 2022-03-22  9:11 UTC (permalink / raw)
  To: linux-btrfs; +Cc: johannes.thumshirn, Naohiro Aota

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(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-01 14:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22  9:11 [PATCH v2 0/2] btrfs: zoned: activate new BG only from extent allocation context Naohiro Aota
2022-03-22  9:11 ` [PATCH v2 1/2] btrfs: return allocated block group from do_chunk_alloc() Naohiro Aota
2022-03-22  9:11 ` [PATCH v2 2/2] btrfs: zoned: activate block group only for extent allocation Naohiro Aota
2022-04-01 14:12   ` David Sterba
2022-03-22 16:03 ` [PATCH v2 0/2] btrfs: zoned: activate new BG only from extent allocation context Johannes Thumshirn
2022-04-01 14:22 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.