]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: vmscan: check if kswapd should writepage once per pgdat scan
authorMel Gorman <mgorman@suse.de>
Thu, 23 May 2013 00:37:19 +0000 (10:37 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 27 May 2013 06:09:05 +0000 (16:09 +1000)
Currently kswapd checks if it should start writepage as it shrinks each
zone without taking into consideration if the zone is balanced or not.
This is not wrong as such but it does not make much sense either.  This
patch checks once per pgdat scan if kswapd should be writing pages.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Cc: Zlatko Calusic <zcalusic@bitsync.net>
Cc: dormando <dormando@rydia.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c

index 45aee36d9b9324a0832bce55a7256d1af2039dce..c223af21d251b198a6d937918cbedf25a6d97b03 100644 (file)
@@ -2850,6 +2850,13 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
                                pgdat_needs_compaction = false;
                }
 
+               /*
+                * If we're getting trouble reclaiming, start doing writepage
+                * even in laptop mode.
+                */
+               if (sc.priority < DEF_PRIORITY - 2)
+                       sc.may_writepage = 1;
+
                /*
                 * Now scan the zone in the dma->highmem direction, stopping
                 * at the last zone which needs scanning.
@@ -2921,13 +2928,6 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
                                        raise_priority = false;
                        }
 
-                       /*
-                        * If we're getting trouble reclaiming, start doing
-                        * writepage even in laptop mode.
-                        */
-                       if (sc.priority < DEF_PRIORITY - 2)
-                               sc.may_writepage = 1;
-
                        if (zone->all_unreclaimable) {
                                if (end_zone && end_zone == i)
                                        end_zone--;