Skip to content

Commit f65e91d

Browse files
Yang Shitorvalds
authored andcommitted
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 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(). Link: http://lkml.kernel.org/r/1464210007-30930-1-git-send-email-yang.shi@linaro.org Signed-off-by: Yang Shi <yang.shi@linaro.org> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent fe53ca5 commit f65e91d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memory_hotplug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat)
300300
* multiple nodes we check that this pfn does not already
301301
* reside in some other nodes.
302302
*/
303-
if (pfn_valid(pfn) && (pfn_to_nid(pfn) == node))
303+
if (pfn_valid(pfn) && (early_pfn_to_nid(pfn) == node))
304304
register_page_bootmem_info_section(pfn);
305305
}
306306
}

0 commit comments

Comments
 (0)