diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index fd40f7e9f176..bd2570b4f9b7 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1611,7 +1611,7 @@ static int scan_movable_pages(unsigned long start, unsigned long end, */ if (HPageMigratable(head)) goto found; - skip = compound_nr(head) - (page - head); + skip = compound_nr(head) - (pfn - page_to_pfn(head)); pfn += skip - 1; } return -ENOENT;