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

Andrew Morton
2004-04-29T03:20:16Z

Marc Singer <elf@buici.com> wrote:
>
> > That's what people have been asking for. What are you suggesting should
> > happen instead?
>
> I'm thinking that the problem is that the page cache is greedier that
> most people expect. For example, if I could hold the page cache to be
> under a specific size, then I could do some performance measurements.
> E.g, compile kernel with a 768K page cache, 512K, 256K and 128K. On a
> machine with loads of RAM, where's the optimal page cache size?

Nope, there's no point in leaving free memory floating about when the
kernel can and will reclaim clean pagecache on demand.

What you discuss above is just an implementation detail. Forget it. What
are the requirements? Thus far I've seen

a) updatedb causes cache reclaim

b) updatedb causes swapout

c) prefer that openoffice/mozilla not get paged out when there's heavy
pagecache demand.

For a) we don't really have a solution. Some have been proposed but they
could have serious downsides.

For b) and c) we can tune the pageout-vs-cache reclaim tendency with
/proc/sys/vm/swappiness, only nobody seems to know that.

What else is there?