Subject: Re: Is O_DIRECT useless on NetBSD?
To: Roland Illig <roland.illig@gmx.de>
From: Antti Kantee <pooka@cs.hut.fi>
List: tech-kern
Date: 11/21/2007 16:39:13
On Wed Nov 21 2007 at 15:11:39 +0100, Roland Illig wrote:
> >Since I expect the program to not read any data twice, I added the
What about other programs? ;)
> >O_DIRECT flag to all open(2) calls. But top(1) still tells me that most
> >of my RAM is occupied by "FILE", and only about 1 megabyte is "Free".
> >
> >All the involved filesystems are ffs. So did I understand O_DIRECT
> >wrong? Or is it at all impossible to disable the kernel cache for file
> >data?
I am assuming your archiver is extending the file. This does not work
for O_DIRECT and it falls back to the buffered path. I am not sure
if there is any real reason why it shouldn't be allowed, but at least
currently the O_DIRECT code doesn't do block allocation. Maybe $ubcgod
knows a deeper truth?
--
Antti Kantee <pooka@iki.fi> Of course he runs NetBSD
http://www.iki.fi/pooka/ http://www.NetBSD.org/
"la qualité la plus indispensable du cuisinier est l'exactitude"