Skip to contentSkip to conversation

md: run RAID-6 stripe operations outside the lock

PATCH In review Yuri Tikhonov 1 participant 1 message Jan 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 4/11 md: run RAID-6 stripe operations outside the lock

The raid_run_ops routine uses the asynchronous offload api and
the stripe_operations member of a stripe_head to carry out xor+pqxor+copy operations asynchronously, outside the lock.

The operations performed by RAID-6 are the same as in the RAID-5 case
except for no support of STRIPE_OP_PREXOR operations. All the others are supported:
STRIPE_OP_BIOFILL
- copy data into request buffers to satisfy a read request
STRIPE_OP_COMPUTE_BLK
- generate missing blocks (1 or 2) in the cache from the other blocks
STRIPE_OP_BIODRAIN
- copy data out of request buffers to satisfy a write request
STRIPE_OP_POSTXOR
- recalculate parity for new data that has entered the cache
STRIPE_OP_CHECK
- verify that the parity is correct

The flow is the same as in the RAID-5 case.

---
 drivers/md/Kconfig         |    2 +
 drivers/md/raid5.c         |  291 +++++++++++++++++++++++++++++++++++++++----
 include/linux/raid/raid5.h |    4 +-
 3 files changed, 269 insertions(+), 28 deletions(-)
drivers/md/Kconfig +2 -0
index 2281b50..6c9964f 100644
@@ -123,6 +123,8 @@ config MD_RAID456
 	depends on BLK_DEV_MD
 	select ASYNC_MEMCPY
 	select ASYNC_XOR
+	select ASYNC_PQ
+	select ASYNC_R6RECOV
 	---help---
 	  A RAID-5 set of N drives with a capacity of C MB per drive provides
 	  the capacity of C * (N - 1) MB, and protects against a failure
drivers/md/raid5.c +264 -27

417 lines not on this page · raw message

include/linux/raid/raid5.h +3 -1
index 3b26727..c832b10 100644
@@ -212,7 +212,7 @@ struct stripe_head {
 	 * @target - STRIPE_OP_COMPUTE_BLK target
 	 */
 	struct stripe_operations {
-		int		   target;
+		int		   target, target2;
 		u32		   zero_sum_result;
 	} ops;
 	struct r5dev {
@@ -295,6 +295,8 @@ struct r6_state {
 #define STRIPE_OP_BIODRAIN	3
 #define STRIPE_OP_POSTXOR	4
 #define STRIPE_OP_CHECK	5
+#define STRIPE_OP_CHECK_PP	6
+#define STRIPE_OP_CHECK_QP	7
 
 /*
  * Plugging:
Signature · 1 line
1.6.0.6