btrfs: reduce the duplicated reads during P/Q scrub
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: scrub: try harder to mark RAID56 block groups read-onlyfs/ fs/ | +22 | 0 replies | |
| 2/2 | btrfs: scrub: use recovered data stripes as cache to avoid unnecessary readfs/ fs/ fs/ | +56 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] btrfs: reduce the duplicated reads during P/Q scrub
[PROBLEM]
It's a known problem that btrfs scrub for RAID56 is pretty slow.
[CAUSE]
One of the causes is that we read the same data stripes at least twice during P/Q stripes scrub.
This means, during a full fs scrub (one scrub process for each device), there will be quite some extra seeks just because of this.
[FIX]
The truth is, scrub stripes have a much better view of the data stripes. As btrfs would firstly verify all data stripes, and only continue scrubing the P/Q stripes if all the data stripes is fine after needed repair.
So this means, as long as there is no new RMW writes into the RAID56 block group, we can re-use the scrub cache for P/Q verification.
This patchset would fix it by:
- Ensure the RAID56 block groups are marked read-only for scrub This is to avoid RMW in to the block group, or scrub cache is no longer reliable.
- Introduce a new interface to pass cached pages to RAID56 cache The only disadvantage is here we still need to do page copy, due to the uncertain lifespan of an rbio.
Qu Wenruo (2):
btrfs: scrub: try harder to mark RAID56 block groups read-only
btrfs: scrub: use recovered data stripes as cache to avoid unnecessary
read
fs/btrfs/block-group.c | 16 +++++++++++++-- fs/btrfs/raid56.c | 46 ++++++++++++++++++++++++++++++++++++++++++ fs/btrfs/raid56.h | 3 +++ fs/btrfs/scrub.c | 16 ++++++++++++++- 4 files changed, 78 insertions(+), 3 deletions(-)
Signature · 1 line
2.39.2