public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/13] btrfs: zoned: split out space_info for dedicated block groups
@ 2025-04-16 14:28 Naohiro Aota
  2025-04-16 14:28 ` [PATCH v3 01/13] btrfs: take btrfs_space_info in btrfs_reserve_data_bytes Naohiro Aota
                   ` (12 more replies)
  0 siblings, 13 replies; 27+ messages in thread
From: Naohiro Aota @ 2025-04-16 14:28 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Naohiro Aota

As discussed in [1], there is a longstanding early ENOSPC issue on the
zoned mode even with simple fio script. This is also causing blktests
zbd/009 to fail [2].

[1] https://lore.kernel.org/linux-btrfs/cover.1731571240.git.naohiro.aota@wdc.com/
[2] https://github.com/osandov/blktests/issues/150

This series is the second part to fix the ENOSPC issue. This series
introduces "space_info sub-space" and use it split a space_info for data
relocation block group and metadata tree-log block group.

Current code assumes we have only one space_info for each block group type
(DATA, METADATA, and SYSTEM). We sometime needs multiple space_info to
manage special block groups.

One example is handling the data relocation block group for the zoned mode.
That block group is dedicated for writing relocated data and we cannot
allocate any regular extent from that block group, which is implemented in
the zoned extent allocator. That block group still belongs to the normal
data space_info. So, when all the normal data block groups are full and
there are some free space in the dedicated block group, the space_info
looks to have some free space, while it cannot allocate normal extent
anymore. That results in a strange ENOSPC error. We need to have a
space_info for the relocation data block group to represent the situation
properly.

Changes:
- v3: 
  - Add proper error handling at ASSERT in btrfs_create_chunk
  - Move the loop on sub_group into check_removing_space_info() 
  - Introduce create_space_info_sub_group() to create sub_group
    space_info.
  - Format fix.
- v2: https://patch.msgid.link/cover.1742364593.git.naohiro.aota@wdc.com
  - Add tree-log sub-space_info implementation.
  - Some spell and style fix.
- v1: https://patch.msgid.link/cover.1733384171.git.naohiro.aota@wdc.com

Naohiro Aota (13):
  btrfs: take btrfs_space_info in btrfs_reserve_data_bytes
  btrfs: take struct btrfs_inode in
    btrfs_free_reserved_data_space_noquota
  btrfs: factor out init_space_info()
  btrfs: spin out do_async_reclaim_{data,metadata}_space()
  btrfs: factor out check_removing_space_info()
  btrfs: introduce space_info argument to btrfs_chunk_alloc
  btrfs: pass space_info for block group creation
  btrfs: introduce btrfs_space_info sub-group
  btrfs: introduce tree-log sub-space_info
  btrfs: tweak extent/chunk allocation for space_info sub-space
  btrfs: use proper data space_info
  btrfs: add block_rsv for treelog
  btrfs: reclaim from sub-space space_info

 fs/btrfs/block-group.c    |  99 +++++++++++++++++-----------
 fs/btrfs/block-group.h    |   7 +-
 fs/btrfs/block-rsv.c      |  12 ++++
 fs/btrfs/block-rsv.h      |   1 +
 fs/btrfs/delalloc-space.c |  24 ++++---
 fs/btrfs/delalloc-space.h |   3 +-
 fs/btrfs/disk-io.c        |   1 +
 fs/btrfs/extent-tree.c    |  20 ++++--
 fs/btrfs/fs.h             |   2 +
 fs/btrfs/inode.c          |   4 +-
 fs/btrfs/relocation.c     |   3 +-
 fs/btrfs/space-info.c     | 134 ++++++++++++++++++++++++++++----------
 fs/btrfs/space-info.h     |  11 +++-
 fs/btrfs/sysfs.c          |  26 ++++++--
 fs/btrfs/transaction.c    |   2 +-
 fs/btrfs/volumes.c        |  22 +++++--
 fs/btrfs/volumes.h        |   3 +-
 17 files changed, 267 insertions(+), 107 deletions(-)

-- 
2.49.0


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

end of thread, other threads:[~2025-04-18  1:08 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 14:28 [PATCH v3 00/13] btrfs: zoned: split out space_info for dedicated block groups Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 01/13] btrfs: take btrfs_space_info in btrfs_reserve_data_bytes Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 02/13] btrfs: take struct btrfs_inode in btrfs_free_reserved_data_space_noquota Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 03/13] btrfs: factor out init_space_info() Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 04/13] btrfs: spin out do_async_reclaim_{data,metadata}_space() Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 05/13] btrfs: factor out check_removing_space_info() Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 06/13] btrfs: introduce space_info argument to btrfs_chunk_alloc Naohiro Aota
2025-04-17 12:38   ` Josef Bacik
2025-04-18  0:59     ` Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 07/13] btrfs: pass space_info for block group creation Naohiro Aota
2025-04-17 12:40   ` Josef Bacik
2025-04-16 14:28 ` [PATCH v3 08/13] btrfs: introduce btrfs_space_info sub-group Naohiro Aota
2025-04-16 14:56   ` Johannes Thumshirn
2025-04-17 12:43   ` Josef Bacik
2025-04-16 14:28 ` [PATCH v3 09/13] btrfs: introduce tree-log sub-space_info Naohiro Aota
2025-04-16 14:57   ` Johannes Thumshirn
2025-04-17 12:44   ` Josef Bacik
2025-04-18  1:08     ` Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 10/13] btrfs: tweak extent/chunk allocation for space_info sub-space Naohiro Aota
2025-04-17  5:48   ` Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 11/13] btrfs: use proper data space_info Naohiro Aota
2025-04-16 14:59   ` Johannes Thumshirn
2025-04-17  4:35     ` Naohiro Aota
2025-04-16 14:28 ` [PATCH v3 12/13] btrfs: add block_rsv for treelog Naohiro Aota
2025-04-17 12:48   ` Josef Bacik
2025-04-16 14:28 ` [PATCH v3 13/13] btrfs: reclaim from sub-space space_info Naohiro Aota
2025-04-17 12:49   ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox