Skip to content

Commit

Permalink
powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID
Browse files Browse the repository at this point in the history
Based off 3bccd99 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>
  • Loading branch information
Nishanth Aravamudan authored and Benjamin Herrenschmidt committed May 28, 2014
1 parent 86969cf commit 8c27226
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 0 additions & 13 deletions arch/powerpc/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? \
Expand Down
6 changes: 6 additions & 0 deletions arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8c27226

Please sign in to comment.