On Mon, Jun 4, 2012 at 1:01 AM, Shaohua Li <shli@xxxxxxxxxx> wrote: > Add a per-stripe lock to protect stripe specific data, like dev->read, > written, ... The purpose is to reduce lock contention of conf->device_lock. > > Signed-off-by: Shaohua Li <shli@xxxxxxxxxxxx> > --- > drivers/md/raid5.c | 17 +++++++++++++++++ > drivers/md/raid5.h | 1 + > 2 files changed, 18 insertions(+) > > Index: linux/drivers/md/raid5.c > =================================================================== > --- linux.orig/drivers/md/raid5.c 2012-06-01 13:38:54.705210229 +0800 > +++ linux/drivers/md/raid5.c 2012-06-01 13:43:05.594056130 +0800 > @@ -749,6 +749,7 @@ static void ops_complete_biofill(void *s > > /* clear completed biofills */ > spin_lock_irq(&conf->device_lock); > + spin_lock_irq(&sh->stripe_lock); > for (i = sh->disks; i--; ) { > struct r5dev *dev = &sh->dev[i]; > > @@ -774,6 +775,7 @@ static void ops_complete_biofill(void *s > } > } > } > + spin_unlock_irq(&sh->stripe_lock); > spin_unlock_irq(&conf->device_lock); Btw... I know this is fixed up in a later patch with the deletion of device_lock, but bisection may land on this patch which enables irqs a bit too early. -- Dan -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html