linux/drivers/md
Jonathan Brassow 475901aff1 MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1)
The MD RAID10 'far' and 'offset' algorithms make copies of entire stripe
widths - copying them to a different location on the same devices after
shifting the stripe.  An example layout of each follows below:

	        "far" algorithm
	dev1 dev2 dev3 dev4 dev5 dev6
	==== ==== ==== ==== ==== ====
	 A    B    C    D    E    F
	 G    H    I    J    K    L
	            ...
	 F    A    B    C    D    E  --> Copy of stripe0, but shifted by 1
	 L    G    H    I    J    K
	            ...

		"offset" algorithm
	dev1 dev2 dev3 dev4 dev5 dev6
	==== ==== ==== ==== ==== ====
	 A    B    C    D    E    F
	 F    A    B    C    D    E  --> Copy of stripe0, but shifted by 1
	 G    H    I    J    K    L
	 L    G    H    I    J    K
	            ...

Redundancy for these algorithms is gained by shifting the copied stripes
one device to the right.  This patch proposes that array be divided into
sets of adjacent devices and when the stripe copies are shifted, they wrap
on set boundaries rather than the array size boundary.  That is, for the
purposes of shifting, the copies are confined to their sets within the
array.  The sets are 'near_copies * far_copies' in size.

The above "far" algorithm example would change to:
	        "far" algorithm
	dev1 dev2 dev3 dev4 dev5 dev6
	==== ==== ==== ==== ==== ====
	 A    B    C    D    E    F
	 G    H    I    J    K    L
	            ...
	 B    A    D    C    F    E  --> Copy of stripe0, shifted 1, 2-dev sets
	 H    G    J    I    L    K      Dev sets are 1-2, 3-4, 5-6
	            ...

This has the affect of improving the redundancy of the array.  We can
always sustain at least one failure, but sometimes more than one can
be handled.  In the first examples, the pairs of devices that CANNOT fail
together are:
	(1,2) (2,3) (3,4) (4,5) (5,6) (1, 6) [40% of possible pairs]
In the example where the copies are confined to sets, the pairs of
devices that cannot fail together are:
	(1,2) (3,4) (5,6)                    [20% of possible pairs]

We cannot simply replace the old algorithms, so the 17th bit of the 'layout'
variable is used to indicate whether we use the old or new method of computing
the shift.  (This is similar to the way the 16th bit indicates whether the
"far" algorithm or the "offset" algorithm is being used.)

This patch only handles the cases where the number of total raid disks is
a multiple of 'far_copies'.  A follow-on patch addresses the condition where
this is not true.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-02-26 11:55:30 +11:00
..
persistent-data Miscellaneous device-mapper fixes, cleanups and performance improvements. 2012-12-21 17:08:06 -08:00
Kconfig dm thin: move bio_prison code to separate module 2012-10-12 21:02:13 +01:00
Makefile dm thin: move bio_prison code to separate module 2012-10-12 21:02:13 +01:00
bitmap.c md/bitmap:Don't use IS_ERR to judge alloc_page(). 2012-10-11 13:45:36 +11:00
bitmap.h md/bitmap: record the space available for the bitmap in the superblock. 2012-05-22 13:55:34 +10:00
dm-bio-prison.c dm thin: replace dm_cell_release_singleton with cell_defer_except 2012-12-21 20:23:31 +00:00
dm-bio-prison.h dm thin: replace dm_cell_release_singleton with cell_defer_except 2012-12-21 20:23:31 +00:00
dm-bio-record.h
dm-bufio.c dm: use ACCESS_ONCE for sysfs values 2012-10-12 16:59:46 +01:00
dm-bufio.h dm bufio: prefetch 2012-03-28 18:41:29 +01:00
dm-crypt.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-delay.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-exception-store.c dm: replace simple_strtoul 2012-07-27 15:07:59 +01:00
dm-exception-store.h
dm-flakey.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-io.c dm kcopyd: add WRITE SAME support to dm_kcopyd_zero 2012-12-21 20:23:37 +00:00
dm-ioctl.c dm ioctl: use kmalloc if possible 2012-12-21 20:23:36 +00:00
dm-kcopyd.c dm kcopyd: add WRITE SAME support to dm_kcopyd_zero 2012-12-21 20:23:37 +00:00
dm-linear.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-log-userspace-base.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
dm-log-userspace-transfer.c connector/userns: replace netlink uses of cap_raised() with capable() 2012-05-10 23:21:39 -04:00
dm-log-userspace-transfer.h
dm-log.c dm: use memweight() 2012-07-30 17:25:16 -07:00
dm-mpath.c dm mpath: fix check for null mpio in end_io fn 2012-10-12 16:59:42 +01:00
dm-mpath.h
dm-path-selector.c md: Add module.h to all files using it implicitly 2011-10-31 19:31:18 -04:00
dm-path-selector.h
dm-queue-length.c dm: reject trailing characters in sccanf input 2012-03-28 18:41:26 +01:00
dm-raid.c DM-RAID: Fix RAID10's check for sufficient redundancy 2013-01-24 12:02:36 +11:00
dm-raid1.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-region-hash.c dm raid1: fix crash with mirror recovery and discard 2012-07-20 14:25:03 +01:00
dm-round-robin.c dm: reject trailing characters in sccanf input 2012-03-28 18:41:26 +01:00
dm-service-time.c dm: reject trailing characters in sccanf input 2012-03-28 18:41:26 +01:00
dm-snap-persistent.c md: Add in export.h for files using EXPORT_SYMBOL 2011-10-31 19:31:19 -04:00
dm-snap-transient.c md: Add in export.h for files using EXPORT_SYMBOL 2011-10-31 19:31:19 -04:00
dm-snap.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-stripe.c dm stripe: add WRITE SAME support 2012-12-21 20:23:41 +00:00
dm-sysfs.c
dm-table.c dm: introduce per_bio_data 2012-12-21 20:23:38 +00:00
dm-target.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-thin-metadata.c dm persistent data: fix nested btree deletion 2012-12-21 20:23:32 +00:00
dm-thin-metadata.h dm thin metadata: introduce dm_pool_abort_metadata 2012-07-27 15:08:15 +01:00
dm-thin.c dm thin: fix queue limits stacking 2013-01-31 14:11:14 +00:00
dm-uevent.c md: Add in export.h for files using EXPORT_SYMBOL 2011-10-31 19:31:19 -04:00
dm-uevent.h
dm-verity.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm-zero.c dm: remove map_info 2012-12-21 20:23:41 +00:00
dm.c dm: fix write same requests counting 2013-01-31 14:23:36 +00:00
dm.h dm: introduce per_bio_data 2012-12-21 20:23:38 +00:00
faulty.c md faulty: use disk_stack_limits() 2012-10-22 10:44:55 +11:00
linear.c md: linear supports TRIM 2012-10-11 13:08:44 +11:00
linear.h md/linear: typedef removal: linear_conf_t -> struct linear_conf 2011-10-11 16:48:54 +11:00
md.c md: protect against crash upon fsync on ro array 2013-02-21 13:28:09 +11:00
md.h md update for 3.8 2012-12-18 09:32:44 -08:00
multipath.c MD: change the parameter of md thread 2012-10-11 13:34:00 +11:00
multipath.h md/multipath: typedef removal: multipath_conf_t -> struct mpconf 2011-10-11 16:48:57 +11:00
raid0.c md: raid 0 supports TRIM 2012-10-11 13:25:44 +11:00
raid0.h md: add proper merge_bvec handling to RAID0 and Linear. 2012-03-19 12:46:39 +11:00
raid1.c md: raid1,10: Handle REQ_WRITE_SAME flag in write bios 2013-02-26 11:55:21 +11:00
raid1.h md/raid1: prevent merging too large request 2012-07-31 10:03:53 +10:00
raid5.c md update for 3.8 2012-12-18 09:32:44 -08:00
raid5.h MD: raid5 trim support 2012-10-11 13:49:05 +11:00
raid10.c MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1) 2013-02-26 11:55:30 +11:00
raid10.h MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1) 2013-02-26 11:55:30 +11:00