diff options
Diffstat (limited to 'kernel/drivers/base/node.c')
-rw-r--r-- | kernel/drivers/base/node.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/drivers/base/node.c b/kernel/drivers/base/node.c index b10479c87..560751bad 100644 --- a/kernel/drivers/base/node.c +++ b/kernel/drivers/base/node.c @@ -359,12 +359,16 @@ int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE #define page_initialized(page) (page->lru.next) -static int get_nid_for_pfn(unsigned long pfn) +static int __init_refok get_nid_for_pfn(unsigned long pfn) { struct page *page; if (!pfn_valid_within(pfn)) return -1; +#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT + if (system_state == SYSTEM_BOOTING) + return early_pfn_to_nid(pfn); +#endif page = pfn_to_page(pfn); if (!page_initialized(page)) return -1; |