Node online means either memory online or cpu online. But there is requirement to instance a pglist_data, which has neither cpu nor memory online (refer to [2/2]).
So carve out the online semantics, and call node_set_online() where either memory or cpu is online. Signed-off-by: Pingfan Liu <kernelf...@gmail.com> Cc: Michal Hocko <mho...@suse.com> Cc: Dave Hansen <dave.han...@linux.intel.com> Cc: Mike Rapoport <r...@linux.ibm.com> Cc: Tony Luck <tony.l...@intel.com> Cc: Andy Lutomirski <l...@kernel.org> Cc: Peter Zijlstra <pet...@infradead.org> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Ingo Molnar <mi...@redhat.com> Cc: Borislav Petkov <b...@alien8.de> Cc: "H. Peter Anvin" <h...@zytor.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Michal Hocko <mho...@suse.com> Cc: Vlastimil Babka <vba...@suse.cz> Cc: Oscar Salvador <osalva...@suse.de> Cc: Pavel Tatashin <pavel.tatas...@microsoft.com> Cc: Mel Gorman <mgor...@techsingularity.net> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Michael Ellerman <m...@ellerman.id.au> Cc: Stephen Rothwell <s...@canb.auug.org.au> Cc: Qian Cai <c...@lca.pw> Cc: Barret Rhoden <b...@google.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: David Rientjes <rient...@google.com> Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- arch/x86/mm/numa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index e6dad60..b48d507 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -213,8 +213,6 @@ static void __init alloc_node_data(int nid) node_data[nid] = nd; memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); - - node_set_online(nid); } /** @@ -589,6 +587,7 @@ static int __init numa_register_memblks(struct numa_meminfo *mi) continue; alloc_node_data(nid); + node_set_online(nid); } /* Dump memblock with node info and return. */ @@ -760,8 +759,10 @@ void __init init_cpu_to_node(void) if (node == NUMA_NO_NODE) continue; - if (!node_online(node)) + if (!node_online(node)) { init_memory_less_node(node); + node_set_online(nid); + } numa_set_node(cpu, node); } -- 2.7.5