aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorGioh Kim <gioh.kim@lge.com>2015-04-15 19:13:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 19:35:17 -0400
commit195b0c60809ce841e5818b365808e7da3286fd3c (patch)
tree9bc2493c7ea9a21f10f0d4ba8cda050bd6eb4b33 /mm
parent3b3636924dfe1e80f9bef2c0dc1207e16f3b078a (diff)
mm/compaction: reset compaction scanner positions
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/compaction.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index 570426edcadf..e6c4f9475d43 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1605,6 +1605,14 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
1605 INIT_LIST_HEAD(&cc->freepages); 1605 INIT_LIST_HEAD(&cc->freepages);
1606 INIT_LIST_HEAD(&cc->migratepages); 1606 INIT_LIST_HEAD(&cc->migratepages);
1607 1607
1608 /*
1609 * When called via /proc/sys/vm/compact_memory
1610 * this makes sure we compact the whole zone regardless of
1611 * cached scanner positions.
1612 */
1613 if (cc->order == -1)
1614 __reset_isolation_suitable(zone);
1615
1608 if (cc->order == -1 || !compaction_deferred(zone, cc->order)) 1616 if (cc->order == -1 || !compaction_deferred(zone, cc->order))
1609 compact_zone(zone, cc); 1617 compact_zone(zone, cc);
1610 1618