|
|
Subscribe / Log in / New account

btrfs: zoned: split out data relocation space_info

From:  Naohiro Aota <naohiro.aota-AT-wdc.com>
To:  linux-btrfs-AT-vger.kernel.org
Subject:  [PATCH 00/11] btrfs: zoned: split out data relocation space_info
Date:  Thu, 05 Dec 2024 16:48:16 +0900
Message-ID:  <cover.1733384171.git.naohiro.aota@wdc.com>
Cc:  Naohiro Aota <naohiro.aota-AT-wdc.com>
Archive-link:  Article

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....
[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.

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.

Naohiro Aota (11):
  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_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: tweak extent/chunk allocation for space_info sub-space
  btrfs: use proper data space_info
  btrfs: reclaim from data sub-space space_info

 fs/btrfs/block-group.c    | 89 ++++++++++++++++++++++++---------------
 fs/btrfs/block-group.h    |  5 ++-
 fs/btrfs/delalloc-space.c | 26 ++++++++----
 fs/btrfs/delalloc-space.h |  3 +-
 fs/btrfs/extent-tree.c    |  5 ++-
 fs/btrfs/inode.c          |  4 +-
 fs/btrfs/relocation.c     |  3 +-
 fs/btrfs/space-info.c     | 84 ++++++++++++++++++++++++------------
 fs/btrfs/space-info.h     | 10 ++++-
 fs/btrfs/sysfs.c          | 16 +++++--
 fs/btrfs/transaction.c    |  2 +-
 fs/btrfs/volumes.c        | 16 ++++---
 fs/btrfs/volumes.h        |  2 +-
 13 files changed, 176 insertions(+), 89 deletions(-)

-- 
2.47.1




Copyright © 2024, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds