On Thu, Jun 07, 2012 at 11:32:39AM +1000, NeilBrown wrote:
> On Mon, 04 Jun 2012 16:01:59 +0800 Shaohua Li <shli@xxxxxxxxxx> wrote:
>
> > Let raid5d handle stripe in batch way to reduce conf->device_lock locking.
> >
> > Signed-off-by: Shaohua Li <shli@xxxxxxxxxxxx>
>
> I like this.
> I don't think it justifies a separate function.
>
> #define MAX_STRIPE_BATCH 8
> struct stripe_head *batch[MAX_STRIPE_BATCH]
> int batch_size = 0;
>
> ...
>
> while (batch_size < MAX_STRPE_BATCH &&
> (sh = __get_priority_stripe(conf)) != NULL)
> batch[batch_size++] = sh;
>
> spin_unlock(&conf->device_lock);
> if (batch_size == 0)
> break;
>
> handled += batch_size;
>
> for (i = 0; i < batch_size; i++)
> handle_stripe(batch[i]);
> cond_resched();
> if (....) md_check_recovery(mddev);
>
> spin_lock_irq(&conf->lock);
> for (i = 0; i < batch_size; i++)
> __release_stripe(batch[i]);
>
>
> something like that?
the 8th patch does the same thing, so I moved the code to a separate function.
--
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
[ATA RAID]
[Linux SCSI Target Infrastructure]
[Managing RAID on Linux]
[Linux IDE]
[Linux SCSI]
[Linux Hams]
[Device-Mapper]
[Kernel]
[Linux Books]
[Linux Admin]
[Linux Net]
[GFS]
[RPM]
[git]
[Photos]
[Yosemite Photos]
[Yosemite News]
[AMD 64]
[Linux Networking]