Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] md/raid5: account discard IO and allow llbitmap discard
@ 2026-06-05  3:22 Yu Kuai
  2026-06-05  3:22 ` [PATCH] md/raid5: account discard IO Yu Kuai
  2026-06-05  3:22 ` [PATCH] md/raid5: allow discard with llbitmap Yu Kuai
  0 siblings, 2 replies; 3+ messages in thread
From: Yu Kuai @ 2026-06-05  3:22 UTC (permalink / raw)
  To: Song Liu; +Cc: Yu Kuai, Li Nan, Xiao Ni, linux-raid, linux-kernel

From: Yu Kuai <yukuai@fygo.io>

Hi,

This series fixes RAID5 discard accounting and then allows RAID5
discard when llbitmap is enabled.

Patch 1 routes processed RAID5 discard bios through md_account_bio().
Since RAID5 only discards whole data stripes, it accounts the exact
full-stripe range that make_discard_request() will submit before
restoring the original bio iterator for completion.

Patch 2 allows discard without devices_handle_discard_safely when
llbitmap is enabled. Legacy bitmap cannot record discarded/unwritten
data and can make later partial writes plus member failure reconstruct
inconsistent data. llbitmap records discarded ranges as unwritten, and
RAID5 already uses that state to force safe recovery paths before
relying on parity.

Runtime validation was done in QEMU with a RAID5 array using a lockless
bitmap and discard-capable disks. Multiple aligned and unaligned
blkdiscard ranges were issued while tracing md_account_bio() and
llbitmap_start_discard(); the llbitmap unwritten-bit deltas matched the
traced bitmap ranges.

Yu Kuai (2):
  md/raid5: account discard IO
  md/raid5: allow discard with llbitmap

 drivers/md/raid5.c | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

-- 
2.51.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-05  3:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05  3:22 [PATCH 0/2] md/raid5: account discard IO and allow llbitmap discard Yu Kuai
2026-06-05  3:22 ` [PATCH] md/raid5: account discard IO Yu Kuai
2026-06-05  3:22 ` [PATCH] md/raid5: allow discard with llbitmap Yu Kuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox