]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/compaction.c
Merge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
[mirror_ubuntu-zesty-kernel.git] / mm / compaction.c
index bd939a574b841d51d704af6a70a5ba7e37dc4e71..d9ebebe1a2aaaea69074fe3615faeddd41a4feb7 100644 (file)
@@ -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;