Skip to contentSkip to conversation

powerpc/numa: Return the first online node instead of 0

RFC PATCH New Aneesh Kumar K.V 1 participant 1 message May 23, 2022 PowerPC

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 powerpc/numa: Return the first online node instead of 0

If early cpu to node mapping finds an invalid node id, return the first online node instead of node 0. On ppc, we can find node 0 not present.

---
 arch/powerpc/include/asm/topology.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/topology.h +1 -1
index 36fcafb1fd6d..3f07231d33b3 100644
@@ -60,7 +60,7 @@ static inline int early_cpu_to_node(int cpu)
 	 * Fall back to node 0 if nid is unset (it should be, except bugs).
 	 * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)).
 	 */
-	return (nid < 0) ? 0 : nid;
+	return (nid < 0) ? first_online_node : nid;
 }
 
 int of_drconf_to_nid_single(struct drmem_lmb *lmb);
Signature · 1 line
2.36.1