Re: O_DIRECT performance impact on 2.4.18 (was: Re: [PATCH] 2.5.14IDE 56)

Andrea Arcangeli
2002-05-10T08:12:29Z

On Fri, May 10, 2002 at 12:15:19AM -0700, Andrew Morton wrote:
> Lincoln Dale wrote:
> >
> > At 11:50 AM 9/05/2002 -0700, Andrew Morton wrote:
> > > > /dev/md0 raid-0 with O_DIRECT: 91847kbyte/sec (2781usec
> > > > /dev/md0
> > > raid-0: 129455kbyte/sec (1978usec
> > > > /dev/md0 raid-0 with O_NOCOPY: 195868kbyte/sec (1297usec
> > >
> > >hmm. Why is O_DIRECT always the slowest? (and it would presumably do
> > >even worse with an 8k transfer size).
> >
> > i just reproduced the test to validate the data. i'm using 8kbyte blocks here.
> > on kernel is 2.4.18, O_DIRECT is still the slowest.
>
> 8k would rather disadvantage O_DIRECT. It can't do readahead and it
> can't to write-behind. It'll be forced to do tons of tiny I/Os.

yes, that's the main factor. Suggested read/write buffer size with
O_DIRECT are of the order of 512k at least (that's the high limit for a
single scsi dma request in 2.4), and 1M even better so you I/O pipeline
some more in the ll_rw_block layer.

Andrea