summaryrefslogtreecommitdiff
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-02-08 19:04:47 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-02-08 19:04:47 -0800
commit15a463532ed22db55339cda370ddd4cf664ad95d (patch)
tree7d4307efe1d167910c4a359673c884c495e0aae9 /mm/compaction.c
parente862f2e4693f287669e84971c778bf071bd0526b (diff)
parent025e4ab3db07fcbf62c01e4f30d1012234beb980 (diff)
Merge branch 'akpm' (Andrew's tree)
Five fixes * branch 'akpm': pcmcia: fix socket refcount decrementing on each resume mm: fix UP THP spin_is_locked BUGs drivers/leds/leds-lm3530.c: fix setting pltfm->als_vmax mm: compaction: check for overlapping nodes during isolation for migration nilfs2: avoid overflowing segment numbers in nilfs_ioctl_clean_segments()
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c11
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,
continue;
nr_scanned++;
- /* Get the page and skip if free */
+ /*
+ * Get the page and ensure the page is within the same zone.
+ * See the comment in isolate_freepages about overlapping
+ * nodes. It is deliberate that the new zone lock is not taken
+ * as memory compaction should not move pages between nodes.
+ */
page = pfn_to_page(low_pfn);
+ if (page_zone(page) != zone)
+ continue;
+
+ /* Skip if free */
if (PageBuddy(page))
continue;