Re: [patch 07/19] (NEW) add some sanity checks to get_scan_ratio

Rik van Riel
2008-01-09T12:53:28Z

On Wed, 9 Jan 2008 13:16:42 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> > +
> > + free = zone_page_state(zone, NR_FREE_PAGES);
> > +
> > + /*
> > + * If we have no swap space, do not bother scanning anon pages
> > + */
> > + if (nr_swap_pages <= 0)
> > + percent[0] = 0;
> Doesn't this mean that swap-cache in ACTIVE_ANON_LIST is not scanned ?
> Or swap-cache is in File-Cache list ?

You are right, the swap cache will not be scanned once we run
completely out of swap space. To compensate for that, this
patch series has a patch that does scanning of swap cache and
freeing of swap space used by pages on the LRU list while there
is still space free.

Scanning all of the anon LRU lists could be a lot of work for
very little gain. A typical large server will have 32GB or
more of RAM, but only the default 2GB of swap.

All we accomplish by scanning the anonymous memory on a system
like that (once swap is full) is eating up CPU time and causing
lock contention.

--
All rights reversed.