]> git.karo-electronics.de Git - linux-beck.git/commitdiff
powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID
authorNishanth Aravamudan <nacc@linux.vnet.ibm.com>
Mon, 19 May 2014 18:14:23 +0000 (11:14 -0700)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 28 May 2014 03:35:33 +0000 (13:35 +1000)
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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/Kconfig
arch/powerpc/include/asm/topology.h
arch/powerpc/kernel/smp.c

index e0998997943bf789cddb11967781b595850574bc..9125964af409b641df741e775761b3394b5b69c1 100644 (file)
@@ -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
index c9202151079f2b1d6e99af4569b82ce68c785573..5ecf7ea52ad846463ab2ba028ae31dc62cedc0a3 100644 (file)
@@ -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 ?                          \
index e2a4232c5871a19056b0b5b666adb540a17b1403..d7252adea759570911c24acc877fd4631c29973f 100644 (file)
@@ -390,6 +390,7 @@ void smp_prepare_boot_cpu(void)
 #ifdef CONFIG_PPC64
        paca[boot_cpuid].__current = current;
 #endif
+       set_numa_node(numa_cpu_lookup_table[boot_cpuid]);
        current_set[boot_cpuid] = task_thread_info(current);
 }
 
@@ -750,6 +751,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);