]> git.hungrycats.org Git - linux/commit
btrfs: stripe_alloc: break rbio pins and open stripe runs down by run class
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 4 Oct 2026 21:46:19 +0000 (17:46 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 8 Nov 2026 23:38:08 +0000 (18:38 -0500)
commit71d9931136cc530ffc7b809adc201065cb14d064
treed0ac8ba53ec2d6b12cd6329af67d338a93de912e
parent0e2f72bd5c19f6fc4882db72afaa06c876f067b2
btrfs: stripe_alloc: break rbio pins and open stripe runs down by run class

Under fsync load the rbio cache holds up to ~190 pins its runs still need,
against 35-55 with the same load on raid1 metadata, so most of them look
like metadata stripes: tree-log blocks share the transaction's META run
with the tree blocks COWed in it, a log commit writes its part of a stripe
and the rest waits for the transaction commit.  Data runs are private per
fsyncing inode and closed at every log commit, so they should be many and
short.  Say which, instead of inferring it.

stripe_park_stats gains rbio_pinned_live_<class> (live pins by the class of
the run that still needs the stripe) and open_runs_<class> (open runs by
class), for class cow, reloc, log, nocow and meta.
btrfs_stripe_run_incomplete() becomes a wrapper around
btrfs_stripe_run_incomplete_class(), which also says which run's class.

[zygo: 7.3 port: 7.3 has no per-chunk stripe length (map->stripe_len,
bioc->stripe_len, the two-argument btrfs_stripe_nr_to_offset()):
BTRFS_STRIPE_LEN is used instead; the change itself is unchanged]

Assisted-by: Claude:claude-opus-5-5
fs/btrfs/block-group.c
fs/btrfs/block-group.h
fs/btrfs/raid56.c
fs/btrfs/raid56.h
fs/btrfs/sysfs.c