Skip to contentSkip to conversation

mm: use early_pfn_to_nid in register_page_bootmem_info_node

PATCH New [email protected] 1 participant 1 message May 27, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 13/19 mm: use early_pfn_to_nid in register_page_bootmem_info_node

From: Yang Shi <[email protected]>
Subject: mm: use early_pfn_to_nid in register_page_bootmem_info_node

register_page_bootmem_info_node() is invoked in mem_init(), so it will be called before page_alloc_init_late() if CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled. But, pfn_to_nid() depends on memmap which won't be fully setup until page_alloc_init_late() is done, so replace pfn_to_nid() by early_pfn_to_nid().

---

 mm/memory_hotplug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-use-early_pfn_to_nid-in-register_page_bootmem_info_node +1 -1
diff -puN mm/memory_hotplug.c~mm-use-early_pfn_to_nid-in-register_page_bootmem_info_node mm/memory_hotplug.c
@@ -300,7 +300,7 @@ void register_page_bootmem_info_node(str
 		 * multiple nodes we check that this pfn does not already
 		 * reside in some other nodes.
 		 */
-		if (pfn_valid(pfn) && (pfn_to_nid(pfn) == node))
+		if (pfn_valid(pfn) && (early_pfn_to_nid(pfn) == node))
 			register_page_bootmem_info_section(pfn);
 	}
 }

_