]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/compaction: reset compaction scanner positions
authorGioh Kim <gioh.kim@lge.com>
Tue, 7 Apr 2015 23:44:28 +0000 (09:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 7 Apr 2015 23:44:28 +0000 (09:44 +1000)
When the compaction is activated via /proc/sys/vm/compact_memory it would
better scan the whole zone.  And some platforms, for instance ARM, have
the start_pfn of a zone at zero.  Therefore the first try to compact via
/proc doesn't work.  It needs to reset the compaction scanner position
first.

Signed-off-by: Gioh Kim <gioh.kim@lge.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c

index 570426edcadf8e08f0adc3ade02841c4fbea9e3e..e6c4f9475d439a76eaa91b187a259f482e794c11 100644 (file)
@@ -1605,6 +1605,14 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
                INIT_LIST_HEAD(&cc->freepages);
                INIT_LIST_HEAD(&cc->migratepages);
 
+               /*
+                * When called via /proc/sys/vm/compact_memory
+                * this makes sure we compact the whole zone regardless of
+                * cached scanner positions.
+                */
+               if (cc->order == -1)
+                       __reset_isolation_suitable(zone);
+
                if (cc->order == -1 || !compaction_deferred(zone, cc->order))
                        compact_zone(zone, cc);