]> git.hungrycats.org Git - linux/commit
btrfs: raid56: skip parking for sync rbios finished by their unplug batch
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 31 Jul 2026 08:41:19 +0000 (04:41 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Mon, 3 Aug 2026 07:22:12 +0000 (03:22 -0400)
commitfb08b3ddd53ee8f2ff3040376070adc6d452fc97
tree0c0390c475ea921778d2946ab48e378c0ceaf019
parent9b861ca579ef909bd41ad3247b1bc859ff4370d8
btrfs: raid56: skip parking for sync rbios finished by their unplug batch

Parking exists to widen the merge window, and for plugged submissions
the unplug callback is the natural end of that window from the
submitter's side: once raid_unplug() has sorted and merged the batch,
nothing more is coming from it.  A sync rbio parked after that point --
a sync(2) or WB_SYNC_ALL sweep, whose whole flush shares one plug --
has a waiter behind it and can only sit out the sync deadline.  Mark
rbios leaving an unplug batch and let sync ones skip parking.

Unplugged sync submissions (the fsync flush) still park: their sibling
bios arrive one by one and merge into the parked rbio, and the fsync
path kicks it as soon as they have all been submitted, so parking there
is the merge mechanism and the deadline already never fires.

Assisted-by: Claude:claude-fable-5
fs/btrfs/raid56.c