diff options
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 9eef55838fca..694eaabaaebd 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -713,7 +713,15 @@ static void isolate_freepages(struct zone *zone, | |||
713 | 713 | ||
714 | /* Found a block suitable for isolating free pages from */ | 714 | /* Found a block suitable for isolating free pages from */ |
715 | isolated = 0; | 715 | isolated = 0; |
716 | end_pfn = min(pfn + pageblock_nr_pages, zone_end_pfn); | 716 | |
717 | /* | ||
718 | * As pfn may not start aligned, pfn+pageblock_nr_page | ||
719 | * may cross a MAX_ORDER_NR_PAGES boundary and miss | ||
720 | * a pfn_valid check. Ensure isolate_freepages_block() | ||
721 | * only scans within a pageblock | ||
722 | */ | ||
723 | end_pfn = ALIGN(pfn + 1, pageblock_nr_pages); | ||
724 | end_pfn = min(end_pfn, zone_end_pfn); | ||
717 | isolated = isolate_freepages_block(cc, pfn, end_pfn, | 725 | isolated = isolate_freepages_block(cc, pfn, end_pfn, |
718 | freelist, false); | 726 | freelist, false); |
719 | nr_freepages += isolated; | 727 | nr_freepages += isolated; |