* Re: performance of O_DIRECT on md/lvm
[not found] ` <m16SPj2-000OVeC@amadeus.home.nl.suse.lists.linux.kernel>
@ 2002-01-20 22:11 ` Andi Kleen
0 siblings, 0 replies; 9+ messages in thread
From: Andi Kleen @ 2002-01-20 22:11 UTC (permalink / raw)
To: arjan; +Cc: linux-kernel
arjan@fenrus.demon.nl writes:
> In article <p734rlg90ga.fsf@oldwotan.suse.de> you wrote:
>
> > I think an optional readahead mode for O_DIRECT would be useful.
>
> I disagree. O_DIRECT says "do not cache. period. I know what I'm doing"
> and the kernel should respect that imho. After all we have sys_readahead for
> the other part...
Problem with sys_readahead is that it doesn't work for big IO sizes.
e.g. you read in big blocks. You have to do readahead(next block);
read(directfd, ..., big-block);
The readahead comes to early in this case; it would be better if it is
done in the middle of read of big-block based on the request size.
Otherwise you risk additional seeks when you overflow the 'read window',
which is all to easy this way.
-Andi
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <200201181743.g0IHhO226012@street-vision.com.suse.lists.linux.kernel>]
* performance of O_DIRECT on md/lvm
@ 2002-01-18 17:43 Justin Cormack
2002-01-18 17:50 ` Arjan van de Ven
0 siblings, 1 reply; 9+ messages in thread
From: Justin Cormack @ 2002-01-18 17:43 UTC (permalink / raw)
To: linux-kernel
Reading files with O_DIRECT works very nicely for me off a single drive
(for video streaming, so I dont want cacheing), but is extremely slow on
software raid0 devices, and striped lvm volumes. Basically a striped
raid device reads at much the same speed as a single device with O_DIRECT,
while reading the same file without O_DIRECT gives the expected performance
(but with unwanted cacheing).
raw devices behave similarly (though if you are using them you can probably
do your own raid0).
My guess is this is because of the md blocksizes being 1024, rather than
4096: is this the case and is there a fix (my quick hack at md.c to try
to make this happen didnt work).
Justin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: performance of O_DIRECT on md/lvm
2002-01-18 17:43 Justin Cormack
@ 2002-01-18 17:50 ` Arjan van de Ven
2002-01-20 19:16 ` Andrea Arcangeli
0 siblings, 1 reply; 9+ messages in thread
From: Arjan van de Ven @ 2002-01-18 17:50 UTC (permalink / raw)
To: Justin Cormack, linux-kernel
Justin Cormack wrote:
>
> Reading files with O_DIRECT works very nicely for me off a single drive
> (for video streaming, so I dont want cacheing), but is extremely slow on
> software raid0 devices, and striped lvm volumes. Basically a striped
> raid device reads at much the same speed as a single device with O_DIRECT,
> while reading the same file without O_DIRECT gives the expected performance
> (but with unwanted cacheing).
>
> raw devices behave similarly (though if you are using them you can probably
> do your own raid0).
>
> My guess is this is because of the md blocksizes being 1024, rather than
> 4096: is this the case and is there a fix (my quick hack at md.c to try
> to make this happen didnt work).
well not exactly. Raid0 is faster due to readahead (eg you read one
block and the kernel
sets the OTHER disk also working in parallel in anticipation of you
using that). O_DIRECT
is of course directly in conflict with this as you tell the kernel that
you DON'T want
any optimisations....
Greetinsg,
Arjan van de Ven
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: performance of O_DIRECT on md/lvm
2002-01-18 17:50 ` Arjan van de Ven
@ 2002-01-20 19:16 ` Andrea Arcangeli
0 siblings, 0 replies; 9+ messages in thread
From: Andrea Arcangeli @ 2002-01-20 19:16 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: Justin Cormack, linux-kernel
On Fri, Jan 18, 2002 at 05:50:53PM +0000, Arjan van de Ven wrote:
> Justin Cormack wrote:
> >
> > Reading files with O_DIRECT works very nicely for me off a single drive
> > (for video streaming, so I dont want cacheing), but is extremely slow on
> > software raid0 devices, and striped lvm volumes. Basically a striped
> > raid device reads at much the same speed as a single device with O_DIRECT,
> > while reading the same file without O_DIRECT gives the expected performance
> > (but with unwanted cacheing).
> >
> > raw devices behave similarly (though if you are using them you can probably
> > do your own raid0).
> >
> > My guess is this is because of the md blocksizes being 1024, rather than
> > 4096: is this the case and is there a fix (my quick hack at md.c to try
> > to make this happen didnt work).
>
> well not exactly. Raid0 is faster due to readahead (eg you read one
> block and the kernel
> sets the OTHER disk also working in parallel in anticipation of you
> using that). O_DIRECT
> is of course directly in conflict with this as you tell the kernel that
> you DON'T want
> any optimisations....
if you read in chunks of a few mbytes per read syscall, the lack of
readahead shouldn't make much difference (this is true for both raid and
standalone device). If there's a relevant difference it's more liekly an
issue with the blocksize.
Andrea
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-01-21 14:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <p734rlg90ga.fsf@oldwotan.suse.de.suse.lists.linux.kernel>
[not found] ` <m16SPj2-000OVeC@amadeus.home.nl.suse.lists.linux.kernel>
2002-01-20 22:11 ` performance of O_DIRECT on md/lvm Andi Kleen
[not found] <200201181743.g0IHhO226012@street-vision.com.suse.lists.linux.kernel>
[not found] ` <3C48607C.35D3DDFF@redhat.com.suse.lists.linux.kernel>
[not found] ` <20020120201603.L21279@athlon.random.suse.lists.linux.kernel>
2002-01-20 21:28 ` Andi Kleen
2002-01-20 21:42 ` arjan
2002-01-21 1:12 ` Andrea Arcangeli
2002-01-21 5:35 ` Benjamin LaHaise
2002-01-21 14:41 ` Andrea Arcangeli
2002-01-18 17:43 Justin Cormack
2002-01-18 17:50 ` Arjan van de Ven
2002-01-20 19:16 ` Andrea Arcangeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox