-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'for-4.16/dm-changes' of git://git.kernel.org/pub/scm/linux…
…/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - DM core fixes to ensure that bio submission follows a depth-first tree walk; this is critical to allow forward progress without the need to use the bioset's BIOSET_NEED_RESCUER. - Remove DM core's BIOSET_NEED_RESCUER based dm_offload infrastructure. - DM core cleanups and improvements to make bio-based DM more efficient (e.g. reduced memory footprint as well leveraging per-bio-data more). - Introduce new bio-based mode (DM_TYPE_NVME_BIO_BASED) that leverages the more direct IO submission path in the block layer; this mode is used by DM multipath and also optimizes targets like DM thin-pool that stack directly on NVMe data device. - DM multipath improvements to factor out legacy SCSI-only (e.g. scsi_dh) code paths to allow for more optimized support for NVMe multipath. - A fix for DM multipath path selectors (service-time and queue-length) to select paths in a more balanced way; largely academic but doesn't hurt. - Numerous DM raid target fixes and improvements. - Add a new DM "unstriped" target that enables Intel to workaround firmware limitations in some NVMe drives that are striped internally (this target also works when stacked above the DM "striped" target). - Various Documentation fixes and improvements. - Misc cleanups and fixes across various DM infrastructure and targets (e.g. bufio, flakey, log-writes, snapshot). * tag 'for-4.16/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (69 commits) dm cache: Documentation: update default migration_throttling value dm mpath selector: more evenly distribute ties dm unstripe: fix target length versus number of stripes size check dm thin: fix trailing semicolon in __remap_and_issue_shared_cell dm table: fix NVMe bio-based dm_table_determine_type() validation dm: various cleanups to md->queue initialization code dm mpath: delay the retry of a request if the target responded as busy dm mpath: return DM_MAPIO_DELAY_REQUEUE if QUEUE_IO or PG_INIT_REQUIRED dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure dm log writes: fix max length used for kstrndup dm: backfill missing calls to mutex_destroy() dm snapshot: use mutex instead of rw_semaphore dm flakey: check for null arg_name in parse_features() dm thin: extend thinpool status format string with omitted fields dm thin: fixes in thin-provisioning.txt dm thin: document representation of <highest mapped sector> when there is none dm thin: fix documentation relative to low water mark threshold dm cache: be consistent in specifying sectors and SI units in cache.txt dm cache: delete obsoleted paragraph in cache.txt dm cache: fix grammar in cache-policies.txt ...
- Loading branch information
Showing
31 changed files
with
1,409 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
Introduction | ||
============ | ||
|
||
The device-mapper "unstriped" target provides a transparent mechanism to | ||
unstripe a device-mapper "striped" target to access the underlying disks | ||
without having to touch the true backing block-device. It can also be | ||
used to unstripe a hardware RAID-0 to access backing disks. | ||
|
||
Parameters: | ||
<number of stripes> <chunk size> <stripe #> <dev_path> <offset> | ||
|
||
<number of stripes> | ||
The number of stripes in the RAID 0. | ||
|
||
<chunk size> | ||
The amount of 512B sectors in the chunk striping. | ||
|
||
<dev_path> | ||
The block device you wish to unstripe. | ||
|
||
<stripe #> | ||
The stripe number within the device that corresponds to physical | ||
drive you wish to unstripe. This must be 0 indexed. | ||
|
||
|
||
Why use this module? | ||
==================== | ||
|
||
An example of undoing an existing dm-stripe | ||
------------------------------------------- | ||
|
||
This small bash script will setup 4 loop devices and use the existing | ||
striped target to combine the 4 devices into one. It then will use | ||
the unstriped target ontop of the striped device to access the | ||
individual backing loop devices. We write data to the newly exposed | ||
unstriped devices and verify the data written matches the correct | ||
underlying device on the striped array. | ||
|
||
#!/bin/bash | ||
|
||
MEMBER_SIZE=$((128 * 1024 * 1024)) | ||
NUM=4 | ||
SEQ_END=$((${NUM}-1)) | ||
CHUNK=256 | ||
BS=4096 | ||
|
||
RAID_SIZE=$((${MEMBER_SIZE}*${NUM}/512)) | ||
DM_PARMS="0 ${RAID_SIZE} striped ${NUM} ${CHUNK}" | ||
COUNT=$((${MEMBER_SIZE} / ${BS})) | ||
|
||
for i in $(seq 0 ${SEQ_END}); do | ||
dd if=/dev/zero of=member-${i} bs=${MEMBER_SIZE} count=1 oflag=direct | ||
losetup /dev/loop${i} member-${i} | ||
DM_PARMS+=" /dev/loop${i} 0" | ||
done | ||
|
||
echo $DM_PARMS | dmsetup create raid0 | ||
for i in $(seq 0 ${SEQ_END}); do | ||
echo "0 1 unstriped ${NUM} ${CHUNK} ${i} /dev/mapper/raid0 0" | dmsetup create set-${i} | ||
done; | ||
|
||
for i in $(seq 0 ${SEQ_END}); do | ||
dd if=/dev/urandom of=/dev/mapper/set-${i} bs=${BS} count=${COUNT} oflag=direct | ||
diff /dev/mapper/set-${i} member-${i} | ||
done; | ||
|
||
for i in $(seq 0 ${SEQ_END}); do | ||
dmsetup remove set-${i} | ||
done | ||
|
||
dmsetup remove raid0 | ||
|
||
for i in $(seq 0 ${SEQ_END}); do | ||
losetup -d /dev/loop${i} | ||
rm -f member-${i} | ||
done | ||
|
||
Another 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 chunk on each core, resulting | ||
in a 256k stripe across the two cores: | ||
|
||
Core 0: Core 1: | ||
__________ __________ | ||
| LBA 512| | 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. This is because the partitions | ||
are striped across the two cores. When we unstripe this hardware RAID 0 | ||
and make partitions on each new exposed device the two partitions are now | ||
physically separated. | ||
|
||
With the dm-unstriped target we're able to segregate an 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 read latency using this device mapper target. | ||
|
||
|
||
Example dmsetup usage | ||
===================== | ||
|
||
unstriped ontop of Intel NVMe device that has 2 cores | ||
----------------------------------------------------- | ||
dmsetup create nvmset0 --table '0 512 unstriped 2 256 0 /dev/nvme0n1 0' | ||
dmsetup create nvmset1 --table '0 512 unstriped 2 256 1 /dev/nvme0n1 0' | ||
|
||
There will now be two devices that expose Intel NVMe core 0 and 1 | ||
respectively: | ||
/dev/mapper/nvmset0 | ||
/dev/mapper/nvmset1 | ||
|
||
unstriped ontop of striped with 4 drives using 128K chunk size | ||
-------------------------------------------------------------- | ||
dmsetup create raid_disk0 --table '0 512 unstriped 4 256 0 /dev/mapper/striped 0' | ||
dmsetup create raid_disk1 --table '0 512 unstriped 4 256 1 /dev/mapper/striped 0' | ||
dmsetup create raid_disk2 --table '0 512 unstriped 4 256 2 /dev/mapper/striped 0' | ||
dmsetup create raid_disk3 --table '0 512 unstriped 4 256 3 /dev/mapper/striped 0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.