[lkml]   [2007]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: O_DIRECT question
On Wed, Jan 10, 2007 at 07:05:30PM -0800, Linus Torvalds wrote:
> I should have fought back harder. There really is no valid reason for EVER
> using O_DIRECT. You need a buffer whatever IO you do, and it might as well
> be the page cache. There are better ways to control the page cache than
> play games and think that a page cache isn't necessary.

There is a valid reason: you really don't want to go through the page
cache when a hard drive has bad blocks. The only way to get fast
recovery and correct error reporting to userspace is by using O_DIRECT.

> So don't use O_DIRECT. Use things like madvise() and posix_fadvise()
> instead.

Both don't do what I want it to do: only read the sector I request you
to read and certainly do not try to outsmart me by doing some kind of


+-- Erik Mouw -- -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
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

 \ /
  Last update: 2007-01-11 14:15    [W:0.132 / U:14.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site