linux/drivers
Dan Williams 91c0092484 md: raid5_run_ops - run stripe operations outside sh->lock
When the raid acceleration work was proposed, Neil laid out the following
attack plan:

1/ move the xor and copy operations outside spin_lock(&sh->lock)
2/ find/implement an asynchronous offload api

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

To perform operations outside the lock a new set of state flags is needed
to track new requests, in-flight requests, and completed requests.  In this
new model handle_stripe is tasked with scanning the stripe_head for work,
updating the stripe_operations structure, and finally dropping the lock and
calling raid5_run_ops for processing.  The following flags outline the
requests that handle_stripe can make of raid5_run_ops:

STRIPE_OP_BIOFILL
 - copy data into request buffers to satisfy a read request
STRIPE_OP_COMPUTE_BLK
 - generate a missing block in the cache from the other blocks
STRIPE_OP_PREXOR
 - subtract existing data as part of the read-modify-write process
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
STRIPE_OP_IO
 - submit i/o to the member disks (note this was already performed outside
   the stripe lock, but it made sense to add it as an operation type

The flow is:
1/ handle_stripe sets STRIPE_OP_* in sh->ops.pending
2/ raid5_run_ops reads sh->ops.pending, sets sh->ops.ack, and submits the
   operation to the async_tx api
3/ async_tx triggers the completion callback routine to set
   sh->ops.complete and release the stripe
4/ handle_stripe runs again to finish the operation and optionally submit
   new operations that were previously blocked

Note this patch just defines raid5_run_ops, subsequent commits (one per
major operation type) modify handle_stripe to take advantage of this
routine.

Changelog:
* removed ops_complete_biodrain in favor of ops_complete_postxor and
  ops_complete_write.
* removed the raid5_run_ops workqueue
* call bi_end_io for reads in ops_complete_biofill, saves a call to
  handle_stripe
* explicitly handle the 2-disk raid5 case (xor becomes memcpy), Neil Brown
* fix race between async engines and bi_end_io call for reads, Neil Brown
* remove unnecessary spin_lock from ops_complete_biofill
* remove test_and_set/test_and_clear BUG_ONs, Neil Brown
* remove explicit interrupt handling for channel switching, this feature
  was absorbed (i.e. it is now implicit) by the async_tx api
* use return_io in ops_complete_biofill

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-By: NeilBrown <neilb@suse.de>
2007-07-13 08:06:15 -07:00
..
acorn
acpi ACPI: fix acpi_osi=!Linux 2007-07-02 21:06:48 -07:00
amba
ata pata_pcmcia: Switch to ata_sff_port_start 2007-07-03 11:31:06 -04:00
atm potential compiler error, irqfunc caller sites update 2007-07-06 10:23:43 -07:00
auxdisplay cfag12864bfb: Use sys_ instead of cfb_ framebuffer accessors 2007-06-01 08:18:28 -07:00
base firmware: remove orphaned Email 2007-06-08 12:41:08 -07:00
block loop: preallocate eight loop devices 2007-06-08 17:23:32 -07:00
bluetooth [Bluetooth] Always send HCI_Reset for Broadcom devices 2007-05-24 14:26:15 +02:00
cdrom potential parse error in ifdef part 3 2007-06-08 17:23:33 -07:00
char Add support SiS based XGI chips to SiS DRM. 2007-06-27 09:54:49 -07:00
clocksource
connector
cpufreq
crypto [CRYPTO] geode: Fix in-place operations and set key 2007-05-24 21:23:24 +10:00
dio
dma async_tx: add the async_tx api 2007-07-13 08:06:14 -07:00
edac
eisa
fc4
firewire firewire: add Kconfig help on building both stacks 2007-06-29 17:32:07 +02:00
firmware
hid
hwmon hwmon/coretemp: fix a broken error path 2007-06-24 08:59:10 -07:00
i2c [ARM] 4403/1: Make the PXA-I2C driver work with lockdep validator 2007-05-26 10:09:39 +01:00
ide qd65xx: fix PIO mode selection 2007-07-08 15:21:58 +02:00
ieee1394 ieee1394: fix to ether1394_tx in ether1394.c 2007-06-16 12:43:20 +02:00
infiniband IPoIB/cm: Partial error clean up unmaps wrong address 2007-07-02 20:48:31 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2007-07-05 15:55:37 -07:00
isdn isdn/diva: fix section mismatch 2007-06-08 17:23:33 -07:00
kvm KVM: Prevent guest fpu state from leaking into the host 2007-06-15 12:30:59 +03:00
leds
macintosh x86_64: Fix only make Macintosh drivers default on Macs 2007-06-22 18:41:18 -07:00
mca
md md: raid5_run_ops - run stripe operations outside sh->lock 2007-07-13 08:06:15 -07:00
media V4L/DVB (5822): Fix the return value in ttpci_budget_init() 2007-07-03 15:11:21 -03:00
message [SCSI] fusion: fix for BZ 8426 - massive slowdown on SCSI CD/DVD drive 2007-06-05 11:04:56 -05:00
mfd SM501: Check SM501 ID register on initialisation 2007-06-24 08:59:11 -07:00
misc Remove the blink driver 2007-07-04 15:24:39 -07:00
mmc mmc: get back read-only switch function 2007-06-13 19:11:20 +02:00
mtd Merge git://git.infradead.org/mtd-2.6 2007-06-04 17:54:09 -07:00
net potential compiler error, irqfunc caller sites update 2007-07-06 10:23:43 -07:00
nubus
oprofile Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
parisc [PARISC] stop lcd driver from stripping initial whitespace 2007-06-21 17:46:19 -04:00
parport [PARISC] fix section mismatch in parport_gsc 2007-05-27 12:13:53 -04:00
pci msi: mask the msix vector before we unmap it 2007-06-01 08:18:27 -07:00
pcmcia at91: fix enable/disable_irq_wake symmetry in pcmcia driver 2007-05-31 07:58:13 -07:00
pnp PNP SMCf010 quirk: work around Toshiba Portege 4000 ACPI issues 2007-07-06 10:23:43 -07:00
ps3
rapidio
rtc RTC: use fallback IRQ if PNP tables don't provide one 2007-06-01 08:18:29 -07:00
s390 s390: netiucv inlining cleanup 2007-06-20 19:12:42 -04:00
sbus [SPARC]: Missing #include <linux/mm.h> in drivers/sbus/char/flash.c 2007-05-31 01:52:53 -07:00
scsi scsi disk help file is not complete 2007-07-02 10:12:34 -04:00
serial serial: clear proper MPSC interrupt cause bits 2007-06-28 11:38:29 -07:00
sh
sn
spi Blackfin SPI driver: fix bug SPI DMA incomplete transmission 2007-06-11 17:34:17 +08:00
tc potential parse error in ifdef part 3 2007-06-08 17:23:33 -07:00
telephony
usb potential compiler error, irqfunc caller sites update 2007-07-06 10:23:43 -07:00
video fix section mismatch in chipsfb 2007-06-28 11:34:54 -07:00
w1 w1_therm_read_bin: don't call flush_signals() 2007-06-28 11:38:19 -07:00
zorro
Kconfig
Makefile