Re: double read in raid1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Also sprach Neil Brown:"
> Sounds like "plugging" might be the thing to do.
> 
> When a read request arrives, just stick it on a queue, counting
>    the number of sectors.
> When an "unplug" call is made:
>     Sort the queue
>     Submit half the sectors to one drive, and the other half
>      to the other drive.

I've been thinking about a couple of possible algorithms. The one above
"suffers" in that it has to deal with the latency caused by the queuing
of requests already in the component drivers (assuming we cannot turn it
off) as well as the component readaheads (ditto).  I don't like
introducing an extra queue on top of that.

How about simply divvying up the mirror into say, 64K (or 2M, whatever)
contiguous regions.  If a read request falls in a even numbered region,
send it to the first drive. If it falls in an odd-numbered region, send
it to the second drive.

The region size should be enough to outpace any likely readahead. But
it should be small enough that a full queue of requests on one of the
component drives can't fit into more than about half a region. That
ensures that when the moment comes that queues on the component drives
are unplugged by the kernel (because they can't queue any more
requests), we haven't sent requests only to one of the drives so far.

That allows the raid driver to send requests 1-by-1 instead of plugging
and queueing itself.

Peter
-
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

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux