In function move_pfn_range_to_zone(), memmap_init_zone() will call set_page_links for each page. This means we don't need to call it on each page explicitly. This patch just removes the loop. Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> --- mm/memory_hotplug.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index d61509752112..4fb1fb2b2b53 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -914,10 +914,6 @@ void __ref move_pfn_range_to_zone(struct zone *zone, * are reserved so nobody should be touching them so we should be safe */ memmap_init_zone(nr_pages, nid, zone_idx(zone), start_pfn, MEMMAP_HOTPLUG); - for (i = 0; i < nr_pages; i++) { - unsigned long pfn = start_pfn + i; - set_page_links(pfn_to_page(pfn), zone_idx(zone), nid, pfn); - } set_zone_contiguous(zone); } -- 2.11.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>