[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0701101902270.3594@woody.osdl.org>
Date: Wed, 10 Jan 2007 19:05:30 -0800 (PST)
From: Linus Torvalds <torvalds@...l.org>
To: Aubrey <aubreylee@...il.com>
cc: Hua Zhong <hzhong@...il.com>, Hugh Dickins <hugh@...itas.com>,
linux-kernel@...r.kernel.org, hch@...radead.org,
kenneth.w.chen@...el.com, akpm@...l.org, mjt@....msk.ru
Subject: Re: O_DIRECT question
On Thu, 11 Jan 2007, Aubrey wrote:
>
> Now, my question is, is there a existing way to mount a filesystem
> with O_DIRECT flag? so that I don't need to change anything in my
> system. If there is no option so far, What is the right way to achieve
> my purpose?
The right way to do it is to just not use O_DIRECT.
The whole notion of "direct IO" is totally braindamaged. Just say no.
This is your brain: O
This is your brain on O_DIRECT: .
Any questions?
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.
So don't use O_DIRECT. Use things like madvise() and posix_fadvise()
instead.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists