* Software RAID0 behaviour/performance on ATA drives
@ 2005-03-24 16:29 Andy Sy
2005-03-25 4:32 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Andy Sy @ 2005-03-24 16:29 UTC (permalink / raw)
To: linux-raid
The recommended setup for doing RAID0 with ATA drives is
that each hard drive should be on its own IDE channel. The
reasoning is so they can operate concurrently... i.e. if you
put them in a master-slave configuration on the same channel,
you lose the benefits of striping since both drives cannot
use the channel at the same time and have to wait for the
others' read/write to finish first.
QUESTION: Is this really accurate? Is the md driver smart/multi-threaded
enough to read/write ahead non-consecutive sectors simultaneously?
When writing, for example, the 1st to 4th chunks of a file across
a striped two-drive array, would it write the 2nd and 4th
chunks on one drive without waiting for the 1st and 3rd chunks
to finish writing on the other?
If it can't, and the writes have to proceed in sequence/lockstep,
how can putting the striped drives on separate channels help?
--
reply-to: a n d y @ n e o t i t a n s . c o m
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Software RAID0 behaviour/performance on ATA drives
2005-03-24 16:29 Software RAID0 behaviour/performance on ATA drives Andy Sy
@ 2005-03-25 4:32 ` Neil Brown
2005-03-25 9:04 ` asho
0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2005-03-25 4:32 UTC (permalink / raw)
To: andy; +Cc: linux-raid
On Friday March 25, andy@nospam.com wrote:
> The recommended setup for doing RAID0 with ATA drives is
> that each hard drive should be on its own IDE channel. The
> reasoning is so they can operate concurrently... i.e. if you
> put them in a master-slave configuration on the same channel,
> you lose the benefits of striping since both drives cannot
> use the channel at the same time and have to wait for the
> others' read/write to finish first.
>
> QUESTION: Is this really accurate? Is the md driver smart/multi-threaded
> enough to read/write ahead non-consecutive sectors simultaneously?
> When writing, for example, the 1st to 4th chunks of a file across
> a striped two-drive array, would it write the 2nd and 4th
> chunks on one drive without waiting for the 1st and 3rd chunks
> to finish writing on the other?
>
> If it can't, and the writes have to proceed in sequence/lockstep,
> how can putting the striped drives on separate channels help?
The raid0 driver is 'clever' at all.
It is given requests by the filesystem or mm subsystem, maps them to
the correct device/sector, and sends them straight on to the
appropriate driver. It never waits for requests, just maps and
forwards.
So if the filesystem sends 128 4k read-ahead requests to the raid0
driver it will forward each one to the relevant device and, depending
on chunk size etc, you might get, say, 32 4K requests sent to each of
4 drives. The drives would (depending on the internals of the driver)
processes all these requests in parallel.
In your example, if the filesystem or mm subsystem submitted writes
for 4 consecutive chunks on a two-drive raid0 array without waiting
for earlier ones to complete before submitting later ones, then they
would all get to the device driver in a timely fashion, and the device
driver(s) should be able to drive the two drives in parallel.
So if the writer handles the required parallelism, and the devices
handle the required parallelism, then the raid0 layer won't interfere
at all.
Hope that makes it clear.
NeilBrown
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Software RAID0 behaviour/performance on ATA drives
2005-03-25 4:32 ` Neil Brown
@ 2005-03-25 9:04 ` asho
2005-03-25 10:03 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: asho @ 2005-03-25 9:04 UTC (permalink / raw)
To: linux-raid
>
> The raid0 driver is 'clever' at all.
> It is given requests by the filesystem or mm subsystem, maps them to
> the correct device/sector, and sends them straight on to the
> appropriate driver. It never waits for requests, just maps and
> forwards.
>
> So if the filesystem sends 128 4k read-ahead requests to the raid0
> driver it will forward each one to the relevant device and, depending
> on chunk size etc, you might get, say, 32 4K requests sent to each of
> 4 drives. The drives would (depending on the internals of the driver)
> processes all these requests in parallel.
>
> In your example, if the filesystem or mm subsystem submitted writes
> for 4 consecutive chunks on a two-drive raid0 array without waiting
> for earlier ones to complete before submitting later ones, then they
> would all get to the device driver in a timely fashion, and the device
> driver(s) should be able to drive the two drives in parallel.
>
> So if the writer handles the required parallelism, and the devices
> handle the required parallelism, then the raid0 layer won't interfere
> at all.
> NeilBrown
Hi Neil
I am curious about that, too. In my memory, the IDE Channel can only
allow one IDE device read/write at once. If one driver(e.g. master)
was writing, the second driver (e.g. slave) must wait until the master
driver finished...
If you were right, can I plug the two disk into the same IDE channel in
raid 1 without losing any performance?
Asho Yeh
--
~ Asho Yeh <asho@debian.org.tw>
'v' GnuPG-Key ID: 1CC92D7F
// \\ Fingerprint: 192B 76FD 5643 6EE7 3DEC 9EAF 3088 48D2 1CC9 2D7F
/( )\
^`~'^
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Software RAID0 behaviour/performance on ATA drives
2005-03-25 9:04 ` asho
@ 2005-03-25 10:03 ` Neil Brown
2005-03-25 12:37 ` asho
0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2005-03-25 10:03 UTC (permalink / raw)
To: asho; +Cc: linux-raid
On Friday March 25, asho@chuany.net wrote:
> >
> > The raid0 driver is 'clever' at all.
Hmm.. that should have been "The raid0 drivers isn't 'clever' at all.
^^^^^
> > It is given requests by the filesystem or mm subsystem, maps them to
> > the correct device/sector, and sends them straight on to the
> > appropriate driver. It never waits for requests, just maps and
> > forwards.
> >
> > So if the filesystem sends 128 4k read-ahead requests to the raid0
> > driver it will forward each one to the relevant device and, depending
> > on chunk size etc, you might get, say, 32 4K requests sent to each of
> > 4 drives. The drives would (depending on the internals of the driver)
> > processes all these requests in parallel.
> >
> > In your example, if the filesystem or mm subsystem submitted writes
> > for 4 consecutive chunks on a two-drive raid0 array without waiting
> > for earlier ones to complete before submitting later ones, then they
> > would all get to the device driver in a timely fashion, and the device
> > driver(s) should be able to drive the two drives in parallel.
> >
> > So if the writer handles the required parallelism, and the devices
> > handle the required parallelism, then the raid0 layer won't interfere
> > at all.
> > NeilBrown
> Hi Neil
>
> I am curious about that, too. In my memory, the IDE Channel can only
> allow one IDE device read/write at once. If one driver(e.g. master)
> was writing, the second driver (e.g. slave) must wait until the master
> driver finished...
>
> If you were right, can I plug the two disk into the same IDE channel in
> raid 1 without losing any performance?
Right about what? I don't think that anything that I wrote can
reasonably be interpreted to say that you can just use one channel
without losing performance.
I said "If ... the devices handles the required parallelism". I don't
know much in detail about IDE (I use SCSI mostly) but if it is true
that you cannot talk to a slave and a master at the same time, then
the drives DO NOT handle the required parallelism, so you don't get
any parallelism.
It is basically completely out of md's hands. It won't get in the way
of parallelism, but it won't make it magically happen if the
drives/controller/drivers cannot make it happen.
Is that any clearer? Or did I misunderstand you.
NeilBrown
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Software RAID0 behaviour/performance on ATA drives
2005-03-25 10:03 ` Neil Brown
@ 2005-03-25 12:37 ` asho
0 siblings, 0 replies; 5+ messages in thread
From: asho @ 2005-03-25 12:37 UTC (permalink / raw)
To: linux-raid
Hi Neil
> Right about what? I don't think that anything that I wrote can
> reasonably be interpreted to say that you can just use one channel
> without losing performance.
>
> I said "If ... the devices handles the required parallelism". I don't
> know much in detail about IDE (I use SCSI mostly) but if it is true
> that you cannot talk to a slave and a master at the same time, then
> the drives DO NOT handle the required parallelism, so you don't get
> any parallelism.
> It is basically completely out of md's hands. It won't get in the way
> of parallelism, but it won't make it magically happen if the
> drives/controller/drivers cannot make it happen.
>
> Is that any clearer? Or did I misunderstand you.
yes, I think I misunderstood first. sorry for that. :-)
I found that some discussion in hardware forums that if UDMA is enabled,
the IDE channel can attach two drivers with a little performance
leakage.
I only tested it with one dvdrw and one dvdrom which attach in the same
channel. The kernel is 2.6 and hdparm -d1 enabled. When I use growisofs
isos to dvdrw and copy data from dvdrom, both of them would slow down
for transfer.
So, I think the IDE isn't parallelism at all. It's better to plug one
driver in an IDE channel. I hope I am not wrong?
Although the IDE and SCSI are different at many perspectives, e.g. SCSI
devices are capable to read/write in the same channel(parallelism).
I still wonder if IDE can do it.
The IDE cables become a mess while many disks in a box. :-(
Thanks for reply.
Asho Yeh
--
~ Asho Yeh <asho@debian.org.tw>
'v' GnuPG-Key ID: 1CC92D7F
// \\ Fingerprint: 192B 76FD 5643 6EE7 3DEC 9EAF 3088 48D2 1CC9 2D7F
/( )\
^`~'^
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-03-25 12:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-24 16:29 Software RAID0 behaviour/performance on ATA drives Andy Sy
2005-03-25 4:32 ` Neil Brown
2005-03-25 9:04 ` asho
2005-03-25 10:03 ` Neil Brown
2005-03-25 12:37 ` asho
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).