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

Andrea Arcangeli (andrea@suse.de)
Fri, 10 May 2002 10:12:58 +0200


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/