Re: [PATCH] O_STREAMING - flag for optimal streaming I/O

From: Robert Love (
Date: Tue Oct 08 2002 - 14:59:50 EST

On Tue, 2002-10-08 at 15:52, Chris Wedgwood wrote:

> On Tue, Oct 08, 2002 at 03:17:16PM -0400, Robert Love wrote:
> > Yep. Linux treats most "hints" (e.g. madvise) as a requirement - it
> > fails if it cannot do it. That is against the spec most of the
> > time, but oh well...
> There is no spec for O_DIRECT... SGI 'invented' this in '93 or perhaps
> earlier (but the idea wasn't new) for IRIX.

I was speaking more of madvise() and in general. I know O_DIRECT does
not have a spec. In general, Linux returns failures on things that many
other operating systems just consider hints (i.e. madvise()).

> O_DIRECT is a very special thing, you shouldn't ask for this unless
> yoy know you want it and how to deal with it --- treating it as
> anything less that a requirement is bogus IMO.

Agreed. Partly why O_STREAMING is needed.

Remember not everything implements O_DIRECT, especially not some odd
device you are streaming into/out of.

I think Andrew summed it up: if O_DIRECT will work in your environment,
and you can rewrite your application, it is probably preferred.
O_STREAMING is a simple solution to solve the pagecache waste which
requires one change to the application.

I did not intend for this to be an O_DIRECT vs. O_STREAMING thread. A
lot of people agree we need something like O_STREAMING - despite never
being implemented, you can find its name referenced often in archives
via google. A much more interesting argument is whether we should not
have an explicit O_STREAMING but instead an intelligent drop-behind
heuristic... but that is a 2.5 issue and the patch is for 2.4.

20% increase in kernel compilation is amazingly nice, for free.

        Robert Love

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:27 EST