aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/compaction.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index 4f0151cfd238..f9792ba3537c 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1039,8 +1039,12 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
1039 } 1039 }
1040 1040
1041 acct_isolated(zone, cc); 1041 acct_isolated(zone, cc);
1042 /* Record where migration scanner will be restarted */ 1042 /*
1043 cc->migrate_pfn = low_pfn; 1043 * Record where migration scanner will be restarted. If we end up in
1044 * the same pageblock as the free scanner, make the scanners fully
1045 * meet so that compact_finished() terminates compaction.
1046 */
1047 cc->migrate_pfn = (end_pfn <= cc->free_pfn) ? low_pfn : cc->free_pfn;
1044 1048
1045 return cc->nr_migratepages ? ISOLATE_SUCCESS : ISOLATE_NONE; 1049 return cc->nr_migratepages ? ISOLATE_SUCCESS : ISOLATE_NONE;
1046} 1050}