linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RAID1 round robin read support in md?
@ 2011-12-04 23:31 Borg Onion
       [not found] ` <CALFpzo48C2-HHgw=iOefdHaAUCwEJfjoiXjq=Ngv62a-0yEpcQ@mail.gmail.com>
  2011-12-05  5:33 ` NeilBrown
  0 siblings, 2 replies; 6+ messages in thread
From: Borg Onion @ 2011-12-04 23:31 UTC (permalink / raw)
  To: linux-raid

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-05 12:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-04 23:31 RAID1 round robin read support in md? Borg Onion
     [not found] ` <CALFpzo48C2-HHgw=iOefdHaAUCwEJfjoiXjq=Ngv62a-0yEpcQ@mail.gmail.com>
     [not found]   ` <CAAs5ODv01LE6HRZjteYYsaMF5stTNv-8pdK9JDP18u4QeNGUOQ@mail.gmail.com>
2011-12-05  3:13     ` Marcus Sorensen
2011-12-05  5:21       ` Borg Onion
2011-12-05  5:53         ` Doug Dumitru
2011-12-05 12:28           ` Roberto Spadim
2011-12-05  5:33 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).