MD Acceleration: md_adma driver for raid5 offload
RFC PATCH 1/1 MD Acceleration: md_adma driver for raid5 offload
This patch provides a re-write of the original raid5.c:compute_parity and raid5.c:copy_data routines. For md_issue_copy_data() special consideration had to be made for highmem buffers, since it appears that holding an atomic mapping until the copy is complete would be problematic. Both routines handle falling back to pio mode if a descriptor resource can not be allocated.
The call back routines contain the stripe state modification code aggregated from the original raid5.c:handle_stripe, raid5.c:compute_parity, and raid5.c:copy_data routines.
Note for debug purposes I copy and pasted the contents of the check_xor () macro into the proper locations.
include/linux/adma/md_adma.h new file +22 -0
@@ -0,0 +1,22 @@ +#ifndef _MD_ADMA_H +#define _MD_ADMA_H +#include <linux/adma/adma.h> +#include <linux/raid/raid5.h> + +struct stripe_head ; +struct bio ; +struct page ; + +int raid5_issue_compute_parity (struct stripe_head *sh,int method); +int md_issue_copy_data (int frombio,struct bio *bio, +struct page *page,sector_t sector, +struct stripe_head *sh,int dev_idx); +/* This flag is used everywhere we can start +* the mdadma thread but are not required. Mainly +* for testing purposes. +* 1 -> start +* 0 -> do not start +*/ +#define MD_ADMA_QUEUE 0 + +#endif
drivers/md/md_adma.c new file +546 -0
546 lines not on this page · raw message