Re: [2.1.130-3] Page cache DEFINATELY too persistant... feature?

Stephen C. Tweedie
1998-11-29T16:05:02Z

Hi,

On 28 Nov 1998 01:31:00 -0600, ebiederm+eric@ccr.net (Eric W. Biederman)
said:

>>>>>> "ST" == Stephen C Tweedie <sct@redhat.com> writes:
ST> Hi,
ST> Looks like I have a handle on what's wrong with the 2.1.130 vm (in
ST> particular, its tendency to cache too much at the expense of
ST> swapping).

> I really should look and play with this but I have one question.

> Why does it make sense when we want memory, to write every page
> we can to swap before we free any memory?

What makes you think we do?

2.1.130 tries to shrink cache until a shrink_mmap() pass fails. Then it
gives the swapper a chance, swapping a batch of pages and unlinking them
from the ptes. The pages so release still stay in the page cache at
this point, btw, and will be picked up again from memory if they get
referenced before the page finally gets discarded. We then go back to
shrink_mmap(), hopefully with a larger population of recyclable pages as
a result of the swapout, and we start using that again.

We only run one batch of swapouts before returning to shrink_mmap.

--Stephen