memcg: fix zone congestion
authorKAMEZAWA Hiroyuki <[email protected]>
Tue, 17 May 2011 22:44:10 +0000 (15:44 -0700)
committerLinus Torvalds <[email protected]>
Wed, 18 May 2011 09:55:23 +0000 (02:55 -0700)
ZONE_CONGESTED should be a state of global memory reclaim.  If not, a busy
memcg sets this and give unnecessary throttoling in wait_iff_congested()
against memory recalim in other contexts.  This makes system performance
bad.

I'll think about "memcg is congested!" flag is required or not, later.
But this fix is required first.

Signed-off-by: KAMEZAWA Hiroyuki <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Cc: Daisuke Nishimura <[email protected]>
Acked-by: Ying Han <[email protected]>
Cc: Balbir Singh <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/vmscan.c

index f6b435c80079337489b17122f0d0ab1b829e12c3..8bfd45050a61494f919e90dfb1538ea8310f4f20 100644 (file)
@@ -937,7 +937,7 @@ keep_lumpy:
         * back off and wait for congestion to clear because further reclaim
         * will encounter the same problem
         */
-       if (nr_dirty == nr_congested && nr_dirty != 0)
+       if (nr_dirty && nr_dirty == nr_congested && scanning_global_lru(sc))
                zone_set_flag(zone, ZONE_CONGESTED);
 
        free_page_list(&free_pages);