diff mbox series

powerpc/numa: Ensure nodes are inited for mem changes

Message ID 20181127215610.3111.59806.stgit@ltczep4-lp5.aus.stglabs.ibm.com (mailing list archive)
State Rejected
Headers show
Series powerpc/numa: Ensure nodes are inited for mem changes | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning next/apply_patch Patch failed to apply
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Michael Bringmann Nov. 27, 2018, 9:56 p.m. UTC
This patch fixes some problems encountered at runtime where changes
to memory affinity changes reference nodes that were not initialized
during system execution after boot.  We are initializing a node
description that may be subsequently used for memory or CPUs before
it can be referenced as invalid.

Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
 arch/powerpc/mm/numa.c |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index d9109e0..f3714fa 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1026,6 +1026,11 @@  int hot_add_scn_to_nid(unsigned long scn_addr)
 			pr_debug("new nid %d for %#010lx\n", nid, scn_addr);
 	}
 
+	if (NODE_DATA(nid) == NULL) {
+		if (try_online_node(nid))
+			nid = first_online_node;
+	}
+
 	return nid;
 }