Skip to content

RFC btrfs: zoned: replace active_total_bytes system

Naohiro Aota linux-btrfs llvm oe-kbuild-all 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: zoned: count fresh BG region as zone unusablefs/btrfs/free-space-cache.c fs/btrfs/zoned.c+25 -50 replies
2/2btrfs: zoned: drop space_info->active_total_bytesfs/btrfs/block-group.c fs/btrfs/space-info.c fs/btrfs/space-info.h +1 more+9 -430 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] btrfs: zoned: replace active_total_bytes system

This series is still not well tested. Please don't merge right now.

The space_info->active_total_bytes is misleading. It counts not only active block groups but also previously active but now inactive (full BGs, due to fully written) ones. That results in a bug not counting the full BGs into active_total_bytes.

Instead, we can count a newly allocated block group's region as zone_unusable. Then, once that block group is activated, subtract [0 .. zone_capcity] from the zone_unusable counters. With this, the regualr space_info's accounting code will align naturally for zone activation support.

Naohiro Aota (2):
btrfs: zoned: count fresh BG region as zone unusable
btrfs: zoned: drop space_info->active_total_bytes

 fs/btrfs/block-group.c      |  6 ------
 fs/btrfs/free-space-cache.c |  8 +++++++-
 fs/btrfs/space-info.c       | 40 +++++++++----------------------------
 fs/btrfs/space-info.h       |  2 --
 fs/btrfs/zoned.c            | 26 ++++++++++++++++--------
 5 files changed, 34 insertions(+), 48 deletions(-)
Signature · 1 line
2.39.2