Re: [PATCH] vmscan: prevent background aging of anon page in no swap system

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ying Han
Date: Sunday, August 29, 2010 - 10:40 pm

On Sun, Aug 29, 2010 at 5:18 PM, Minchan Kim <minchan.kim@gmail.com> wrote:

Minchan, I would prefer to make kswapd as well as direct reclaim to be
consistent if possible.
They both try to reclaim pages when system is under memory pressure,
and also do not make
much sense to look at anon lru if no swap space available. Either
because of no swapon or run
out of swap space.

I think letting kswapd to age anon lru without free swap space is not
necessary neither. That leads
to my initial patch:

@@ -1605,6 +1605,9 @@ static int inactive_anon_is_low(struct zone
*zone, struct scan_control *sc)
 {
       int low;

+       if (nr_swap_pages <= 0)
+               return 0;
+
       if (scanning_global_lru(sc))
               low = inactive_anon_is_low_global(zone);
       else
@@ -1856,7 +1859,7 @@ static void shrink_zone(int priority, struct zone *zone,
        * Even if we did not try to evict anon pages at all, we want to
        * rebalance the anon lru active/inactive ratio.
        */
-       if (inactive_anon_is_low(zone, sc) && nr_swap_pages > 0)
+       if (inactive_anon_is_low(zone, sc))
               shrink_active_list(SWAP_CLUSTER_MAX, zone, sc, priority, 0);

What do you think ?

--Ying
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] vmscan: prevent background aging of anon page ..., Ying Han, (Sun Aug 29, 10:40 pm)
Re: [PATCH] vmscan: prevent background aging of anon page ..., Venkatesh Pallipadi, (Fri Sep 3, 6:12 pm)