aboutsummaryrefslogtreecommitdiffstats
path: root/mm/compaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index 8ea7308..88d55f4 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -81,6 +81,11 @@ static unsigned long isolate_freepages_block(struct zone *zone,
if (!pfn_valid_within(blockpfn))
continue;
+
+ /* Watch for unexpected holes punched in the memmap */
+ if (!memmap_valid_within(blockpfn, page, zone))
+ continue;
+
nr_scanned++;
if (!PageBuddy(page))
@@ -175,6 +180,11 @@ static void isolate_freepages(struct zone *zone,
* pages do not belong to a single zone.
*/
page = pfn_to_page(pfn);
+
+ /* Watch for unexpected holes punched in the memmap */
+ if (!memmap_valid_within(pfn, page, zone))
+ continue;
+
if (page_zone(page) != zone)
continue;
@@ -337,6 +347,11 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
* as memory compaction should not move pages between nodes.
*/
page = pfn_to_page(low_pfn);
+
+ /* Watch for unexpected holes punched in the memmap */
+ if (!memmap_valid_within(low_pfn, page, zone))
+ continue;
+
if (page_zone(page) != zone)
continue;