linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: numa: enable USE_PERCPU_NUMA_NODE_ID
@ 2014-05-16 23:39 Nishanth Aravamudan
  2014-05-16 23:41 ` [PATCH 2/2] powerpc: numa: enable CONFIG_HAVE_MEMORYLESS_NODES Nishanth Aravamudan
  2014-05-19 18:14 ` [RFC PATCH v2 1/2] powerpc: numa: enable USE_PERCPU_NUMA_NODE_ID Nishanth Aravamudan
  0 siblings, 2 replies; 8+ messages in thread
From: Nishanth Aravamudan @ 2014-05-16 23:39 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Lee Schermerhorn, Christoph Lameter, Mel Gorman, linux-mm,
	Anton Blanchard, David Rientjes, Joonsoo Kim, linuxppc-dev

Based off 3bccd996 for ia64, convert powerpc to use the generic per-CPU
topology tracking, specifically:
    
	initialize per cpu numa_node entry in start_secondary
    	remove the powerpc cpu_to_node()
    	define CONFIG_USE_PERCPU_NUMA_NODE_ID if NUMA
    
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index e099899..9125964 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -453,6 +453,10 @@ config NODES_SHIFT
 	default "4"
 	depends on NEED_MULTIPLE_NODES
 
+config USE_PERCPU_NUMA_NODE_ID
+	def_bool y
+	depends on NUMA
+
 config ARCH_SELECT_MEMORY_MODEL
 	def_bool y
 	depends on PPC64
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index c920215..5ecf7ea 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -20,19 +20,6 @@ struct device_node;
 
 #include <asm/mmzone.h>
 
-static inline int cpu_to_node(int cpu)
-{
-	int nid;
-
-	nid = numa_cpu_lookup_table[cpu];
-
-	/*
-	 * During early boot, the numa-cpu lookup table might not have been
-	 * setup for all CPUs yet. In such cases, default to node 0.
-	 */
-	return (nid < 0) ? 0 : nid;
-}
-
 #define parent_node(node)	(node)
 
 #define cpumask_of_node(node) ((node) == -1 ?				\
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index e2a4232..b95be24 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -750,6 +750,11 @@ void start_secondary(void *unused)
 	}
 	traverse_core_siblings(cpu, true);
 
+	/*
+	 * numa_node_id() works after this.
+	 */
+	set_numa_node(numa_cpu_lookup_table[cpu]);
+
 	smp_wmb();
 	notify_cpu_starting(cpu);
 	set_cpu_online(cpu, true);

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

end of thread, other threads:[~2014-05-28 23:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16 23:39 [PATCH] powerpc: numa: enable USE_PERCPU_NUMA_NODE_ID Nishanth Aravamudan
2014-05-16 23:41 ` [PATCH 2/2] powerpc: numa: enable CONFIG_HAVE_MEMORYLESS_NODES Nishanth Aravamudan
2014-05-19 18:14 ` [RFC PATCH v2 1/2] powerpc: numa: enable USE_PERCPU_NUMA_NODE_ID Nishanth Aravamudan
2014-05-27 23:44   ` Nishanth Aravamudan
2014-05-27 23:56     ` Benjamin Herrenschmidt
2014-05-28  0:09       ` Nishanth Aravamudan
2014-05-28 23:36         ` Andrew Morton
2014-05-28 23:43           ` Nishanth Aravamudan

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).