linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc/numa: Return the first online node instead of 0
@ 2022-06-23 12:54 Aneesh Kumar K.V
  2022-06-23 12:54 ` [PATCH 2/2] powerpc/numa: Return the first online node if device tree mapping returns a not online node Aneesh Kumar K.V
  2022-06-24  8:39 ` [PATCH 1/2] powerpc/numa: Return the first online node instead of 0 Srikar Dronamraju
  0 siblings, 2 replies; 6+ messages in thread
From: Aneesh Kumar K.V @ 2022-06-23 12:54 UTC (permalink / raw)
  To: linuxppc-dev, mpe; +Cc: Aneesh Kumar K.V, Srikar Dronamraju

If early cpu to node mapping finds an invalid node id, return
the first online node instead of node 0.

With commit e75130f20b1f ("powerpc/numa: Offline memoryless cpuless node 0")
the kernel marks node 0 offline in certain scenarios.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 arch/powerpc/include/asm/topology.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 8a4d4f4d9749..704088b1d53c 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -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);
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-27 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 12:54 [PATCH 1/2] powerpc/numa: Return the first online node instead of 0 Aneesh Kumar K.V
2022-06-23 12:54 ` [PATCH 2/2] powerpc/numa: Return the first online node if device tree mapping returns a not online node Aneesh Kumar K.V
2022-06-24  8:50   ` Srikar Dronamraju
2022-06-27  5:27     ` Aneesh Kumar K.V
2022-06-24  8:39 ` [PATCH 1/2] powerpc/numa: Return the first online node instead of 0 Srikar Dronamraju
2022-06-27 14:05   ` Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).