Skip to content

md/md-llbitmap: support reshape for RAID10 and RAID5

Yu Kuai linux-raid lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest21 patches 1 replyIn review
  2. v220 patches 2 repliesSuperseded
  3. v11 patch 0 repliesSuperseded

Changes in v3 from the cover letter

- Fix RAID5 bitmap stripe rounding for non-power-of-two stripe widths in patch 1.
- Fix partial discard chunks being marked unwritten in patch 11.
- Fix RAID5 writes past component size being skipped by llbitmap accounting in patch 11.
- Fix stopped reshape reassembly losing target llbitmap geometry in patch 9.
- Fix the page-cache-grow patch using target-geometry fields before they are introduced in patch 7.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21md/raid5: round bitmap stripes with sector divisiondrivers/md/raid5.c+9 -40 replies
2/21md: add exact bitmap mapping and reshape hooksdrivers/md/md-bitmap.c drivers/md/md-bitmap.h drivers/md/md-llbitmap.c +2 more+36 -40 replies
3/21md: skip bitmap accounting for empty write rangesdrivers/md/md.c+7 -20 replies
4/21md: add helper to split bios at reshape offsetdrivers/md/md.c drivers/md/md.h+43 -00 replies
5/21md/md-llbitmap: track bitmap sync_size explicitlydrivers/md/md-llbitmap.c+12 -20 replies
6/21md/md-llbitmap: allocate page controls independentlydrivers/md/md-llbitmap.c+62 -370 replies
7/21md/md-llbitmap: grow the page cache in place for reshapedrivers/md/md-llbitmap.c+124 -120 replies
8/21md/md-llbitmap: track target reshape geometry fieldsdrivers/md/md-llbitmap.c+42 -00 replies
9/21md/md-llbitmap: finish reshape geometrydrivers/md/md-llbitmap.c+34 -00 replies
10/21md/md-llbitmap: refuse reshape while llbitmap still needs syncdrivers/md/md-llbitmap.c+24 -00 replies
11/21md/md-llbitmap: add reshape range mapping helpersdrivers/md/md-bitmap.c drivers/md/md-bitmap.h drivers/md/md-llbitmap.c +1 more+132 -120 replies
12/21md/md-llbitmap: don't skip reshape ranges from bitmap statedrivers/md/md-llbitmap.c+8 -00 replies
13/21md/md-llbitmap: remap checkpointed bits as reshape progressesdrivers/md/md-llbitmap.c+172 -00 replies
14/21md/md-llbitmap: clamp state-machine walks to tracked bitsdrivers/md/md-llbitmap.c+4 -10 replies
15/21md/raid10: reject llbitmap reshape when md chunk shrinksdrivers/md/raid10.c+4 -00 replies
16/21md/raid10: wire llbitmap reshape lifecycledrivers/md/raid10.c+39 -00 replies
17/21md/raid10: split reshape bios before bitmap accountingdrivers/md/raid10.c+6 -00 replies
18/21md/raid5: add exact old and new llbitmap mapping helpersdrivers/md/raid5.c+52 -200 replies
19/21md/raid5: reject llbitmap reshape when md chunk shrinksdrivers/md/raid5.c+3 -00 replies
20/21md/raid5: wire llbitmap reshape lifecycledrivers/md/raid5.c+37 -00 replies
21/21md/raid5: split reshape bios before bitmap accountingdrivers/md/raid5.c+8 -00 replies

Reviews trailers per patch

2 of 21 patches have a Reviewed-by or Acked-by.

PatchSu Yue
1/21
2/21
3/21
4/21
5/21R-b
6/21R-b
7/21
8/21
9/21
10/21
11/21
12/21
13/21
14/21
15/21
16/21
17/21
18/21
19/21
20/21
21/21

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/21] md/md-llbitmap: support reshape for RAID10 and RAID5

From: Yu Kuai <[email protected]>

Hi,

This series adds llbitmap support for online reshape in RAID10 and RAID5.

llbitmap has a different set of constraints from the existing bitmap code:
there is one live bitmap instance, each bit state has richer semantics, and reshape can change the mapping from logical array ranges to bitmap ranges. The series therefore adds exact bitmap range mapping hooks, tracks old and new llbitmap geometry during reshape, remaps checkpointed bits as reshape progresses, and wires the reshape lifecycle into RAID10 and RAID5.

The main rules are:

1. split bios at the reshape position before bitmap accounting, so one bio is never accounted with mixed old/new geometry;
2. do not skip reshape ranges from stale llbitmap state, because reshape progress is checkpointed by array metadata;
3. remap llbitmap bits when reshape progress is checkpointed;
4. reject llbitmap reshape if mddev->chunk_sectors shrinks, because the effective data range represented by existing bitmap bits can shrink.

The first patch fixes RAID5 bitmap stripe rounding before the exact mapping hooks are added, so the later RAID5 helper split starts from correct sector_t division semantics. The rest of the series prepares generic bitmap and llbitmap infrastructure, wires RAID10, and then wires RAID5 with exact old/new stripe mapping.

Changes since v2:
- Fix RAID5 bitmap stripe rounding for non-power-of-two stripe widths in patch 1.
- Fix partial discard chunks being marked unwritten in patch 11.
- Fix RAID5 writes past component size being skipped by llbitmap accounting in patch 11.
- Fix stopped reshape reassembly losing target llbitmap geometry in patch 9.
- Fix the page-cache-grow patch using target-geometry fields before they are introduced in patch 7.

Changes since v1:
- Add Reviewed-by tags from Su Yue.
- Rename llbitmap_resize_chunks() to llbitmap_calculate_chunks().
- Use an unsigned index in llbitmap_expand_pages() error cleanup.
- Rebase on mdraid/md-7.2, including the mddev_bio_split_at_reshape_offset() declaration needed by the RAID5 build reported by kernel test robot.

Yu Kuai (21):
md/raid5: round bitmap stripes with sector division
md: add exact bitmap mapping and reshape hooks
md: skip bitmap accounting for empty write ranges
md: add helper to split bios at reshape offset md/md-llbitmap: track bitmap sync_size explicitly md/md-llbitmap: allocate page controls independently md/md-llbitmap: grow the page cache in place for reshape md/md-llbitmap: track target reshape geometry fields md/md-llbitmap: finish reshape geometry md/md-llbitmap: refuse reshape while llbitmap still needs sync md/md-llbitmap: add reshape range mapping helpers md/md-llbitmap: don't skip reshape ranges from bitmap state md/md-llbitmap: remap checkpointed bits as reshape progresses md/md-llbitmap: clamp state-machine walks to tracked bits md/raid10: reject llbitmap reshape when md chunk shrinks md/raid10: wire llbitmap reshape lifecycle md/raid10: split reshape bios before bitmap accounting md/raid5: add exact old and new llbitmap mapping helpers md/raid5: reject llbitmap reshape when md chunk shrinks md/raid5: wire llbitmap reshape lifecycle
md/raid5: split reshape bios before bitmap accounting

 drivers/md/md-bitmap.c   |   8 +
 drivers/md/md-bitmap.h   |   9 +
 drivers/md/md-llbitmap.c | 659 ++++++++++++++++++++++++++++++++++++---
 drivers/md/md.c          |  64 +++-
 drivers/md/md.h          |   8 +
 drivers/md/raid10.c      |  49 +++
 drivers/md/raid5.c       | 123 ++++++--
 7 files changed, 842 insertions(+), 78 deletions(-)

base-commit: 55b77337bdd088c77461588e5ec094421b89911b

Signature · 1 line
2.51.0