public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Chris Wedgwood <cw@f00f.org>
Cc: linux-kernel@vger.kernel.org, akpm@digeo.com, riel@conectiva.com.br
Subject: Re: [PATCH] O_STREAMING - flag for optimal streaming I/O
Date: 08 Oct 2002 15:17:16 -0400	[thread overview]
Message-ID: <1034104637.29468.1483.camel@phantasy> (raw)
In-Reply-To: <20021008190513.GA4728@tapu.f00f.org>

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

> > In other words, this flag pretty much disables the pagecache for
> > this mapping, although we happily keep it around for write-behind
> > and read-ahead.  But once the data is behind us and safe to kill, we
> > do.  It is manual drop-behind.
> 
> OK.  What might use this though?  What applications might want to
> disable the page-cache but still use write-behind?

Streaming I/O wants read-ahead.  Filesystems themselves implement the
write-behind and we do not want to circumvent so much of the kernel.

The point of O_STREAMING is one change: drop pages in the pagecache
behind our current position, that are free-able, because we know we will
never want them.  Its a hint from the application saying "I will never
revisit this so dump it".

O_DIRECT is a much bigger can of worms.  You lose a lot of what the
kernel provides.  You have to do things in block-sized chunks.  Etc.
etc.

> > O_DIRECT has a lot of semantics, one of which is to attempt to
> > minimize cache effects.
> 
> It depends on the OS.  Some OS are broken and treat O_DIRECT as a
> hint, Linux and IRIX know it's a *requirement*.

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...

> > O_STREAMING would be for your TiVo or network audio streamer.  Any
> > file I/O that is inherently sequential and access-once.  No point
> > trashing the pagecache with its data - but otherwise the behavior is
> > normal.
> 
> Actually, this sounds perfect for O_DIRECT.  But I don't know much
> about streaming video.
>
> Since you only want the data once, why use the page-cache at all and
> needlessly copy?  Certainly, the requirements for O_DIRECT are not
> that hard to meet or implement.
>
> Don't get me wrong, I'm not saying this is a bad thing at all.  The
> patch is small and elegant so it's hard to object; I'm just trying to
> understand where in practice I would use this over O_DIRECT.

Shrug.  I do not have much experience with O_DIRECT.  I suspect the
synchronous nature and the requirement of aligned buffers is not ideal.

With O_STREAMING you can simply set the flag and use your normal I/O and
normal interfaces and have a field day.

Andrew, any experience on one vs. the other?

	Robert Love 


  reply	other threads:[~2002-10-08 20:20 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08  2:38 [PATCH] O_STREAMING - flag for optimal streaming I/O Robert Love
2002-10-08 10:42 ` J.A. Magallon
2002-10-08 18:08   ` Robert Love
2002-10-08 18:38 ` Chris Wedgwood
2002-10-08 18:49   ` Robert Love
2002-10-08 19:05     ` Chris Wedgwood
2002-10-08 19:17       ` Robert Love [this message]
2002-10-08 19:30         ` Andrew Morton
2002-10-09 14:14           ` Marco Colombo
2002-10-09 16:30           ` kernel
2002-10-08 19:52         ` Chris Wedgwood
2002-10-08 19:59           ` Robert Love
2002-10-08 20:01             ` Chris Wedgwood
2002-10-09  8:33         ` Giuliano Pochini
2002-10-09  8:43           ` Andrew Morton
2002-10-09 10:55             ` Giuliano Pochini
2002-10-09 17:05           ` Mark Mielke
2002-10-09 19:36             ` Giuliano Pochini
2002-10-09 22:24               ` Mark Mielke
2002-10-09 23:20                 ` Jamie Lokier
2002-10-10  3:07                   ` Mark Mielke
2002-10-10 10:55                     ` Helge Hafting
2002-10-10 17:50                       ` Mark Mielke
2002-10-10  3:29                   ` Erik Andersen
2002-10-10  3:37                     ` Robert Love
2002-10-10 13:39                       ` Giuliano Pochini
2002-10-10 22:50                         ` Mike Fedyk
2002-10-10 22:58                           ` Erik Andersen
2002-10-11  8:26                           ` Giuliano Pochini
2002-10-11  8:32                           ` Helge Hafting
2002-10-10  8:33                     ` Giuliano Pochini
2002-10-10  9:10                       ` Erik Andersen
2002-10-10  9:38                         ` Giuliano Pochini
2002-10-10 10:40                           ` Miquel van Smoorenburg
2002-10-10 11:01                           ` Helge Hafting
2002-10-10 12:29                             ` Xavier Bestel
2002-10-10 13:17                             ` Giuliano Pochini
2002-10-10 22:44                               ` Mike Fedyk
2002-10-11  8:13                                 ` Giuliano Pochini
2002-10-10 11:38                     ` O_STREAMING has insufficient info - how about fadvise() ? Alan Cox
2002-10-10 11:47                       ` William Lee Irwin III
2002-10-10 15:34                       ` Andrew Morton
2002-10-10 16:08                         ` Alan Cox
2002-10-10 16:49                         ` Oliver Xymoron
2002-10-10 15:37                     ` [PATCH] O_STREAMING - flag for optimal streaming I/O Gerhard Mack
2002-10-10 22:47                       ` Mike Fedyk
2002-10-11  2:14                         ` Gerhard Mack
2002-10-11  8:10                           ` Chris Wedgwood
2002-10-10  9:14                 ` David Lang
2002-10-10 14:51               ` Denis Vlasenko
2002-10-08 19:53       ` Matthias Schniedermeyer
2002-10-08 19:59         ` Chris Wedgwood
2002-10-08 20:03         ` Andrew Morton
2002-10-08 20:34           ` Matthias Schniedermeyer
2002-10-08 20:42             ` Andrew Morton
2002-10-08 20:37           ` Larry McVoy
2002-10-09 11:53 ` Roy Sigurd Karlsbakk
2002-10-09 14:10 ` Marco Colombo
2002-10-09 14:14   ` Robert Love
2002-10-09 14:33     ` Richard B. Johnson
2002-10-09 15:27     ` Andreas Dilger
2002-10-09 23:17       ` Jamie Lokier
2002-10-09 23:46       ` Rik van Riel
2002-10-10  0:16         ` Jamie Lokier
2002-10-10  2:39           ` Erik Andersen
2002-10-10 10:33         ` Marco Colombo
2002-10-10 20:00           ` Erik Andersen
  -- strict thread matches above, loose matches on Subject: below --
2002-10-11  4:16 Hank Leininger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1034104637.29468.1483.camel@phantasy \
    --to=rml@tech9.net \
    --cc=akpm@digeo.com \
    --cc=cw@f00f.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox