diff options
| -rw-r--r-- | mm/compaction.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index bd939a574b84..d9ebebe1a2aa 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
| @@ -330,8 +330,17 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, | |||
| 330 | continue; | 330 | continue; |
| 331 | nr_scanned++; | 331 | nr_scanned++; |
| 332 | 332 | ||
| 333 | /* Get the page and skip if free */ | 333 | /* |
| 334 | * Get the page and ensure the page is within the same zone. | ||
| 335 | * See the comment in isolate_freepages about overlapping | ||
| 336 | * nodes. It is deliberate that the new zone lock is not taken | ||
| 337 | * as memory compaction should not move pages between nodes. | ||
| 338 | */ | ||
| 334 | page = pfn_to_page(low_pfn); | 339 | page = pfn_to_page(low_pfn); |
| 340 | if (page_zone(page) != zone) | ||
| 341 | continue; | ||
| 342 | |||
| 343 | /* Skip if free */ | ||
| 335 | if (PageBuddy(page)) | 344 | if (PageBuddy(page)) |
| 336 | continue; | 345 | continue; |
| 337 | 346 | ||
