md: run RAID-6 stripe operations outside the lock
Subsystems (2)
PATCH v2 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 requestSTRIPE_OP_COMPUTE_BLK
- generate missing blocks (1 or 2) in the cache from the other blocksSTRIPE_OP_BIODRAIN
- copy data out of request buffers to satisfy a write requestSTRIPE_OP_POSTXOR
- recalculate parity for new data that has entered the cacheSTRIPE_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 | 292 ++++++++++++++++++++++++++++++++++++++++---- include/linux/raid/raid5.h | 6 +- 3 files changed, 271 insertions(+), 29 deletions(-)
drivers/md/Kconfig +2 -0
@@ -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 +265 -27
418 lines not on this page · raw message
include/linux/raid/raid5.h +4 -2
@@ -212,8 +212,8 @@ struct stripe_head {* @target - STRIPE_OP_COMPUTE_BLK target */ struct stripe_operations { -int target; -u32 zero_sum_result; +int target, target2; +u32 zero_sum_result, zero_qsum_result; } ops;struct r5dev {struct bio req;
@@ -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.5.6.1