Skip to contentSkip to conversation

async_tx: RAID-6 recovery implementation

PATCH In review Yuri Tikhonov 2 participants 2 messages Dec 4, 2007 – Dec 28, 2007

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

PATCH 2/12 async_tx: RAID-6 recovery implementation

This patch adds support for asynchronous RAID-6 recovery operations.

An asynchronous implementation using async_tx API is provided to compute
two missing data blocks (async_r6_dd_recov) and to compute one missing data block and one missing parity_block (async_r6_dp_recov).

In general, the RAID-6 recovery API is the wrappers which organize the
calculations algorithms using async_pqxor().

Please refer to the "The mathematics of RAID-6" wtite-paper written by
H.Peter Anvin available at www.kernel.org/pub/linux/kernel/people/hpa/raid6.pdf for the theoretical basement of the algorithms implemented here.

--

crypto/async_tx/Kconfig +4 -0
index b1705d1..b2423e9 100644
@@ -18,3 +18,7 @@ config ASYNC_PQXOR
 	tristate
 	select ASYNC_CORE
 
+config ASYNC_R6RECOV
+	tristate
+	select ASYNC_CORE
+
crypto/async_tx/Makefile +1 -0
index 32d6ce2..76fcd43 100644
@@ -3,3 +3,4 @@ obj-$(CONFIG_ASYNC_MEMCPY) += async_memcpy.o
 obj-$(CONFIG_ASYNC_MEMSET) += async_memset.o
 obj-$(CONFIG_ASYNC_XOR) += async_xor.o
 obj-$(CONFIG_ASYNC_PQXOR) += async_pqxor.o
+obj-$(CONFIG_ASYNC_R6RECOV) += async_r6recov.o
crypto/async_tx/async_r6recov.c new file +314 -0

314 lines not on this page · raw message

include/linux/async_tx.h +11 -0
index 80bf0a3..d587872 100644
@@ -166,4 +166,15 @@ async_pqxor_zero_sum(struct page *pdest, struct page *qdest,
 	struct dma_async_tx_descriptor *depend_tx,
 	dma_async_tx_callback callback, void *callback_param);
 
+struct dma_async_tx_descriptor *
+async_r6_dd_recov (int src_num, size_t bytes, int faila, int failb,
+	struct page **ptrs, enum async_tx_flags flags,
+	struct dma_async_tx_descriptor *depend_tx,
+	dma_async_tx_callback callback, void *callback_param);
+
+struct dma_async_tx_descriptor *
+async_r6_dp_recov (int src_num, size_t bytes, int faila, struct page **ptrs,
+	enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
+	dma_async_tx_callback callback, void *callback_param);
+
 #endif /* _ASYNC_TX_H_ */
Signature · 2 lines
Yuri Tikhonov, Senior Software Engineer
Emcraft Systems, www.emcraft.com
#1 lore raw
Quoted 9 lines · Yuri Tikhonov

This patch adds support for asynchronous RAID-6 recovery operations.

An asynchronous implementation using async_tx API is provided to compute
two missing data blocks (async_r6_dd_recov) and to compute one missing data block and one missing parity_block (async_r6_dp_recov).

In general, the RAID-6 recovery API is the wrappers which organize the
calculations algorithms using async_pqxor().

Quoted 7 lines

Please refer to the "The mathematics of RAID-6" wtite-paper written by
H.Peter Anvin available at www.kernel.org/pub/linux/kernel/people/hpa/raid6.pdf for the theoretical basement of the algorithms implemented here.

--

I really, *really*, don't like the name "pqxor", because it is actively misleading. The P syndrome is an XOR, but the Q syndrome is not, and in particular, does not exhibit the same properties as one would expect from an XOR, in particular commutativity.

-hpa