Skip to content

A dm-raid45 target implemented using md raid5.

NeilBrown dm-devel linux-raid 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12md: reduce dependence on sysfs.drivers/md/md.c drivers/md/md.h drivers/md/raid5.c+62 -590 replies
2/12md/raid5: factor out code for changing size of stripe cache.drivers/md/raid5.c+25 -130 replies
3/12md/dm: create dm-raid456 module using md/raid5drivers/md/Kconfig drivers/md/Makefile drivers/md/dm-raid456.c +2 more+474 -170 replies
4/12dm-raid456: add support for raising events to userspace.drivers/md/dm-raid456.c drivers/md/md.c drivers/md/md.h+11 -00 replies
5/12raid5: Don't set read-ahead when there is no queuedrivers/md/raid5.c+16 -140 replies
6/12dm-raid456: add congestion checking.drivers/md/dm-raid456.c drivers/md/dm-table.c drivers/md/raid5.c +2 more+56 -70 replies
7/12md/raid5: add simple plugging infrastructure.drivers/md/md.c drivers/md/md.h drivers/md/raid5.c +1 more+94 -140 replies
8/12md/plug: optionally use plugger to unplug an array during resync/recovery.drivers/md/md.c drivers/md/md.h drivers/md/raid5.c+15 -30 replies
9/12dm-raid456: support unplugdrivers/md/dm-raid456.c drivers/md/dm-table.c drivers/md/raid5.c +2 more+20 -60 replies
10/12dm-raid456: add support for setting IO hints.drivers/md/dm-raid456.c drivers/md/raid5.c+43 -90 replies
11/12dm-raid456: add suspend/resume methoddrivers/md/dm-raid456.c drivers/md/md.c drivers/md/md.h+22 -20 replies
12/12dm-raid456: add message handler.drivers/md/dm-raid456.c drivers/md/raid5.c drivers/md/raid5.h+29 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] A dm-raid45 target implemented using md raid5.

Greetings Heinz, Alasdair, and all,
(Alasdair and Heinz cc:ed on this intro, but the patches are
only going to the lists).

Some months ago I posted a proof-of-concept patch which attempted to provide RAID4/5/6 functionality to 'dm' using md/raid5.c. While it did a least partly work it contained lots of hacks and was very ugly.

I finally made time to do the job "properly".

The following series, when applied on top of a bunch of patches I just submitted for linux-next, provides a 'dm-raid45' target which is largely compatible with the one that Heinz has written (and several distros are shipping), but which uses md/raid5.c for the core IO processing.

I have tried to split the patch up into easy-to-handle pieces. You will note that some changes to core-dm are required, in particular to pass back 'congestion' information and to handle plugging (which raid5 uses to improve throughput). I hope the approach I have taken is suitable, but it can obviously be changed if necessary.

The create/status/message interface differs from the one in Heinz's patch, but should be close enough to work with current 'dmraid'.

If you want to try the patches (rather than just read them) you should probably "git pull" (please don't clone) from

      git://neil.brown.name/md md-dm-raid45

so as to get all the prior refactoring patches in md.

Some advantages of this over Heinz's patch (at least as it was when I last looked at it) are:
- raid6 support
- support for XOR-offload hardware where present
- less code duplication
- a single dm device can include multiple dm-raid45 targets. (Heinz' code accesses dm_disk(md)->queue directly which is a layering violations and assumes that there is no other target in the mapped_device).

There is a lot more that could be done to this such as getting to work with a disk based dirty-log and making the reshape options available. But this patch set should provide all basic RAID5 functionality.

Would the dm community be interested in including this work upstream (after suitable review and testing)?

Thanks,
NeilBrown

---

NeilBrown (12):
md: reduce dependence on sysfs.
md/raid5: factor out code for changing size of stripe cache. md/dm: create dm-raid456 module using md/raid5
dm-raid456: add support for raising events to userspace.
raid5: Don't set read-ahead when there is no queue
dm-raid456: add congestion checking.
md/raid5: add simple plugging infrastructure.
md/plug: optionally use plugger to unplug an array during resync/recovery.
dm-raid456: support unplug
dm-raid456: add support for setting IO hints.
dm-raid456: add suspend/resume method
dm-raid456: add message handler.

 drivers/md/Kconfig            |    8 +
 drivers/md/Makefile           |    1 
 drivers/md/dm-raid456.c       |  540 +++++++++++++++++++++++++++++++++++++++++
 drivers/md/dm-table.c         |   19 +
 drivers/md/md.c               |  211 ++++++++++------
 drivers/md/md.h               |   43 +++
 drivers/md/raid5.c            |  155 +++++++-----
 drivers/md/raid5.h            |    6 
 include/linux/device-mapper.h |   13 +
 9 files changed, 859 insertions(+), 137 deletions(-)
 create mode 100644 drivers/md/dm-raid456.c