btrfs: zoned: split out space_info for dedicated block groups
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest13 patches 1 replyIn review
- v313 patches 13 repliesSuperseded
- v213 patches 16 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 11 patches | 7 replies | Superseded |
Changes from the cover letter
- v4:
- Pass down space_info from top of call tree, instead querying it at the bottom.
- Make BTRFS_SUB_GROUP_* id distinct.
- Use treelog_rsv on regular btrfs too.
- Fix NULL dereference bug.
- Some format and commit log fix.
- v3: https://patch.msgid.link/[email protected]
- 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/[email protected]
- Add tree-log sub-space_info implementation.
- Some spell and style fix.
- v1: https://patch.msgid.link/[email protected]
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | btrfs: take btrfs_space_info in btrfs_reserve_data_bytesfs/ fs/ fs/ | +8 | 0 replies | |
| 2/13 | btrfs: take struct btrfs_inode in btrfs_free_reserved_data_space_noquotafs/ fs/ fs/ +1 more | +8 | 0 replies | |
| 3/13 | btrfs: factor out init_space_info()fs/ | +16 | 0 replies | |
| 4/13 | btrfs: spin out do_async_reclaim_{data,metadata}_space()fs/ | +29 | 0 replies | |
| 5/13 | btrfs: factor out check_removing_space_info()fs/ | +29 | 0 replies | |
| 6/13 | btrfs: introduce space_info argument to btrfs_chunk_allocfs/ fs/ fs/ +2 more | +27 | 0 replies | |
| 7/13 | btrfs: pass space_info for block group creationfs/ fs/ fs/ +1 more | +58 | 0 replies | |
| 8/13 | btrfs: introduce btrfs_space_info sub-groupfs/ fs/ fs/ +1 more | +75 | 0 replies | |
| 9/13 | btrfs: introduce tree-log sub-space_infofs/ fs/ fs/ | +14 | 0 replies | |
| 10/13 | btrfs: tweak extent/chunk allocation for space_info sub-spacefs/ fs/ fs/ | +31 | 0 replies | |
| 11/13 | btrfs: use proper data space_infofs/ | +12 | 0 replies | |
| 12/13 | btrfs: add block_rsv for treelogfs/ fs/ fs/ +2 more | +20 | 0 replies | |
| 13/13 | btrfs: reclaim from sub-space space_infofs/ | +7 | 0 replies |
Reviews trailers per patch
11 of 13 patches have a Reviewed-by or Acked-by.
| Patch | Johannes Thumshirn |
|---|---|
| 1/13 | R-b |
| 2/13 | R-b |
| 3/13 | R-b |
| 4/13 | R-b |
| 5/13 | R-b |
| 6/13 | |
| 7/13 | |
| 8/13 | R-b |
| 9/13 | R-b |
| 10/13 | R-b |
| 11/13 | R-b |
| 12/13 | R-b |
| 13/13 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/13] btrfs: zoned: split out space_info for dedicated block groups
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/[email protected]/
[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:
- v4:
- Pass down space_info from top of call tree, instead querying it at the bottom.
- Make BTRFS_SUB_GROUP_* id distinct.
- Use treelog_rsv on regular btrfs too.
- Fix NULL dereference bug.
- Some format and commit log fix.
- v3: https://patch.msgid.link/[email protected]
- 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/[email protected]
- Add tree-log sub-space_info implementation.
- Some spell and style fix.
- v1: https://patch.msgid.link/[email protected]
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 | 123 ++++++++++++++++++--------- fs/btrfs/block-group.h | 7 +- fs/btrfs/block-rsv.c | 11 +++ fs/btrfs/block-rsv.h | 1 + fs/btrfs/delalloc-space.c | 27 ++++-- 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 | 169 ++++++++++++++++++++++++++------------ fs/btrfs/space-info.h | 11 ++- fs/btrfs/sysfs.c | 27 +++++- fs/btrfs/transaction.c | 5 +- fs/btrfs/volumes.c | 36 ++++++-- fs/btrfs/volumes.h | 3 +- 17 files changed, 328 insertions(+), 125 deletions(-)
Signature · 1 line
2.49.0