RAID1 round robin read support in md?

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

 



Hello,

Is it possible to implement round-robin read support for raid1.c in
md?  I sure would appreciate the extra speed given my RAID1x3SSD
setup.  A possible algorithm might go like this:

1) Given the RAID1 drives are enumerated 0,1,2
2) For each read request, call an atomic increment
3) mod the returned value with # of drives (3)
4) Use the modulus result as the drive # to read from for this operation

Part of implementation might look like this:

uint32_t get_next_read_drive(uint32_t num_drives)
{
        static uint32_t op_count;

        return __sync_fetch_and_add(&op_count, 1) % num_drives;
}

I'm making the assumption that the md code is multi-threaded.  This
implementation won't work on all platforms, others might have to do
some locking.  The num_drives and drive list enumeration is assumed to
exclude write-mostly devices.  Temporary balancing fairness errors
from the num_drives variable changing value (adding or removing of
drives) should be innocuous given these are just read ops on mirrored
data.

Thoughts?

--
Borg Onion
--
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