Re: double read in raid1

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

 



On Tuesday August 24, ptb@xxxxxxxxxx wrote:
> In raid1 one could read from both (or more drives) and discard all read
> returns except the first.  This should be fractionally faster than
> reading from one drive alone in most circumstances.
> 
> However, one can also split the reads so that if say 128 requests are
> queued, then the lowest 64 are read from one drive and the highest 64
> from another.  With luck, that would amount to doubling the read rate,
> as there would be little overlap on what is read from the two drives,
> and requests are issued asyncronously.
> 
> Curiously, that is about what the current code does (by accident, and
> slightly wrongly), but it stops doing it in exactly the circumstances
> when it would do good - during a linear set of contiguous reads.  In
> that case one should issue 50% of each batch of requests given to the
> request function to one drive, and the other 50% as far away as possible
> to the other drive. The current code does no switch half way through
> each batch of requests (where it would do good), but instead after
> counting through exactly 128 requests, which is a pretty random point 
> in a batch.
> 
> If the reads come from all over the shop, then one still gains from
> doing half on one drive and half on the other, so long as one does
> both halves at the same time and one arranges that the readaheads
> do not overlap the reads from the other drives (it's easier to say
> that they don't when reads are a contiguous linear sequence, which is
> why I said that that's the case when one should be sharing reads
> between two drives).

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.

Further refinements:
  Not "half" but "1/N" if there are "N" drives.
  Keep track of number of outstanding reads per drive, and
  submit fewer requests to busier drives.

Does that sound like what you want?

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