Re: ~500 megs cached yet 2.6.5 goes into swap hell

Andrew Morton
2004-04-30T00:34:47Z

Andy Isaacson <adi@hexapodia.org> wrote:
>
> But in a related case, I have a background daemon that does a lot of IO
> (mostly sequential, one page at a time read/modify/write of a multi-GB
> file) to a filesystem on a separate spindle from my main filesystems.
> I'd like to use a similar mechanism to say "don't let this program eat
> my pagecache" that will let the daemon crunch away without severely
> impacting my desktop work.

fadvise(POSIX_FADV_DONTNEED) is ideal for this. Run it once per megabyte
or so.