Skip to content

btrfs: zoned: reduce lock contention in zoned extent allocator

Johannes Thumshirn linux-btrfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesIn review
  2. v13 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Rewording of the commit message (Damien)
- No more local variables caching the values (Damien)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: zoned: get rid of relocation_bg_lockfs/btrfs/disk-io.c fs/btrfs/extent-tree.c fs/btrfs/fs.h +1 more+17 -342 replies
2/3btrfs: zoned: get rid of treelog_bg_lockfs/btrfs/disk-io.c fs/btrfs/extent-tree.c fs/btrfs/fs.h +2 more+14 -450 replies
3/3btrfs: zoned: don't hold space_info lock on zoned allocationfs/btrfs/extent-tree.c+0 -30 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/3] btrfs: zoned: reduce lock contention in zoned extent allocator

From: Johannes Thumshirn <[email protected]>

While investigating performance issues on zoned btrfs, I've analyzed lockstat output while running fio workloads.

Three locks that have always been on top are the space_info's ->lock, as well as fs_info's ->treelog_bg_lock and ->relocation_bg_lock.

The first one is not as trivial to get rid and most likely legit in most cases (see patch #3). The other two are only protecting a single value in fs_info and can be replaced by REAC_ONCE() and WRITE_ONCE().

The series has been run through fstests on tcmu-runner emulated SMR drives as well as Damien's fio benchmarks on real ZNS hardware and no regressions have been observed.

Changes in v2:
- Rewording of the commit message (Damien)
- No more local variables caching the values (Damien)

Johannes Thumshirn (3):
btrfs: zoned: get rid of relocation_bg_lock
btrfs: zoned: get rid of treelog_bg_lock
btrfs: zoned: don't hold space_info lock on zoned allocation

 fs/btrfs/disk-io.c     |  2 -
 fs/btrfs/extent-tree.c | 86 +++++++++++-------------------------------
 fs/btrfs/fs.h          |  7 +---
 fs/btrfs/zoned.c       | 12 +++---
 fs/btrfs/zoned.h       |  6 +--
 5 files changed, 31 insertions(+), 82 deletions(-)
Signature · 1 line
2.49.0