Subject: Re: Is O_DIRECT useless on NetBSD?
To: None <tech-kern@NetBSD.org>
From: Roland Illig <firstname.lastname@example.org>
Date: 11/21/2007 16:08:59
Antti Kantee wrote:
> 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? ;)
Cannot be. :) First, I freed some memory by using "yes | less", and when
I interrupted that, I had 300 MB free. Then I started my archiver, and
the free memory decreased with approximately the speed of data consumed
> 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?
So am I right that currently there is no way for a program to say "I
will write some data to that file, and nobody is going to use it in the
next time, so please don't buffer it"?
I'm asking because it is pretty annoying that the cached data for
programs I often run (like firefox, eclipse) is displaced by data that
will not be used. That makes starting these programs very slow.