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 17:17:48
On Wed Nov 21 2007 at 16:08:59 +0100, Roland Illig wrote:
> 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
> by it.
No I meant how do you know other programs won't be accessing the data
you are processing with your archiver.
> 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.
I'm not sure. You could try mmap + madvise, e.g. madvise MADV_FREE
after processing if you're *sure* you won't never ever access the data in
another program. But that's slightly tedious in any case as you need to
truncate + move window + do io. Ok, might not be that much more tedious.
--
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"