dm-unstripe: unstripe of IO across RAID 0
Subsystems (3)
PATCH 1/2 dm-unstripe: unstripe of IO across RAID 0
This device mapper module remaps and unstripes IO so it lands solely on a single drive in a RAID 0. In a 4 drive RAID 0 the mapper exposes 1/4th of the LBA range as a virtual drive. Each IO to that virtual drive will land on only one of the 4 drives, selected by the user.
As an example:
Intel NVMe drives contain two cores on the physical device. Each core of the drive has segregated access to its LBA range. The current LBA model has a RAID 0 128k stripe across the two cores:
Core 0: Core 1:
__________ __________ | LBA 511| | LBA 768| | LBA 0 | | LBA 256|
The purpose of this unstriping is to provide better QoS in noisy neighbor environments. When two partitions are created on the aggregate drive without this unstriping, reads on one partition can affect writes on another partition. With the striping concurrent reads and writes and I/O on opposite cores have lower completion times, and better tail latencies.
--- drivers/md/Kconfig | 10 +++ drivers/md/Makefile | 1 + drivers/md/dm-unstripe.c | 197 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 208 insertions(+) create mode 100644 drivers/md/dm-unstripe.c
drivers/md/Kconfig +10 -0
@@ -269,6 +269,16 @@ config DM_BIO_PRISON source "drivers/md/persistent-data/Kconfig" +config DM_UN_STRIPE + tristate "Transpose IO to individual drives on a raid device" + depends on BLK_DEV_DM + ---help--- + Enable this feature if you with to unstripe I/O on a RAID 0 + device to the respective drive. If your hardware has physical + RAID 0 this module can unstripe the I/O to respective sides. + + If unsure say N. + config DM_CRYPT tristate "Crypt target support" depends on BLK_DEV_DM
drivers/md/Makefile +1 -0
@@ -43,6 +43,7 @@ obj-$(CONFIG_BCACHE) += bcache/ obj-$(CONFIG_BLK_DEV_MD) += md-mod.o obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o obj-$(CONFIG_BLK_DEV_DM_BUILTIN) += dm-builtin.o +obj-$(CONFIG_DM_UN_STRIPE) += dm-unstripe.o obj-$(CONFIG_DM_BUFIO) += dm-bufio.o obj-$(CONFIG_DM_BIO_PRISON) += dm-bio-prison.o obj-$(CONFIG_DM_CRYPT) += dm-crypt.o
drivers/md/dm-unstripe.c new file +197 -0
197 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH 2/2 dm unstripe: Add documentation for unstripe target
--- Documentation/device-mapper/dm-unstripe.txt | 82 +++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/device-mapper/dm-unstripe.txt
Documentation/device-mapper/dm-unstripe.txt new file +82 -0
@@ -0,0 +1,82 @@ +Device-Mapper Unstripe +===================== + +The device-mapper Unstripe (dm-unstripe) target provides a transparent +mechanism to unstripe a RAID 0 striping to access segregated disks. + +This module should be used by users who understand what the underlying +disks look like behind the Software/Hardware RAID. + +Parameters: +<drive (ex: /dev/nvme0n1)> <drive #> <# of drives> <stripe sectors> + + +<drive> + The block device you wish to unstripe. + +<drive #> + The physical drive you wish to expose via this "virtual" device + mapper target. This must be 0 indexed. + +<# of drives> + The number of drives in the RAID 0. + +<stripe sectors> + The amount of 512B sectors in the raid striping, or zero, if you + wish you use max_hw_sector_size. + + +Why use this module? +===================== + +As a use case: + + + As an example: + + Intel NVMe drives contain two cores on the physical device. + Each core of the drive has segregated access to its LBA range. + The current LBA model has a RAID 0 128k stripe across the two cores: + + Core 0: Core 1: + __________ __________ + | LBA 511| | LBA 768| + | LBA 0 | | LBA 256| + ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ + + The purpose of this unstriping is to provide better QoS in noisy + neighbor environments. When two partitions are created on the + aggregate drive without this unstriping, reads on one partition + can affect writes on another partition. With the striping concurrent + reads and writes and I/O on opposite cores have lower completion times, + and better tail latencies. + + With the module we were able to segregate a fio script that has read and + write jobs that are independent of each other. Compared to when we run + the test on a combined drive with partitions, we were able to get a 92% + reduction in five-9ths read latency using this device mapper target. + + + One could use the module to Logical de-pop a HDD if you have sufficient + geomoetry information regarding the drive. + + +Example scripts: +==================== + +dmsetup create nvmset1 --table '0 1 dm-unstripe /dev/nvme0n1 1 2 0' +dmsetup create nvmset0 --table '0 1 dm-unstripe /dev/nvme0n1 0 2 0' + +There will now be two mappers: +/dev/mapper/nvmset1 +/dev/mapper/nvmset0 + +that will expose core 1 and core 2. + + +In a Raid 0 with 4 drives of stripe size 128K: +dmsetup create raid_disk0 --table '0 1 dm-unstripe /dev/nvme0n1 0 4 256' +dmsetup create raid_disk1 --table '0 1 dm-unstripe /dev/nvme0n1 1 4 256' +dmsetup create raid_disk2 --table '0 1 dm-unstripe /dev/nvme0n1 2 4 256' +dmsetup create raid_disk3 --table '0 1 dm-unstripe /dev/nvme0n1 3 4 256' +
Signature · 1 line
2.11.0