Commit 195b0c60 authored by Gioh Kim's avatar Gioh Kim Committed by Linus Torvalds

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
Signed-off-by: default avatarGioh Kim <>
Acked-by: default avatarVlastimil Babka <>
Acked-by: default avatarDavid Rientjes <>
Cc: Joonsoo Kim <>
Cc: Mel Gorman <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 3b363692
......@@ -1605,6 +1605,14 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
* 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)
if (cc->order == -1 || !compaction_deferred(zone, cc->order))
compact_zone(zone, cc);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment