Commit ef6574ff authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: fix initialisation of NUMA arrays

From: Anton Blanchard <anton@samba.org>

We were hitting problems on machines with cpu_possible != cpu_online when
NUMA was enabled.  The debug checks would trip during scheduler init
because we iterate through all possible cpus whereas we only set up NUMA
information for online cpus.

Longer term we should have a cpu_up hook which sets up its NUMA information
but for now we initalise all possible cpus and memory to node 0.
parent dcdeeef8
......@@ -22,9 +22,17 @@
#define dbg(args...)
#endif
int numa_cpu_lookup_table[NR_CPUS] = { [ 0 ... (NR_CPUS - 1)] = -1};
#ifdef DEBUG_NUMA
#define ARRAY_INITIALISER -1
#else
#define ARRAY_INITIALISER 0
#endif
int numa_cpu_lookup_table[NR_CPUS] = { [ 0 ... (NR_CPUS - 1)] =
ARRAY_INITIALISER};
int numa_memory_lookup_table[MAX_MEMORY >> MEMORY_INCREMENT_SHIFT] =
{ [ 0 ... ((MAX_MEMORY >> MEMORY_INCREMENT_SHIFT) - 1)] = -1};
{ [ 0 ... ((MAX_MEMORY >> MEMORY_INCREMENT_SHIFT) - 1)] =
ARRAY_INITIALISER};
cpumask_t numa_cpumask_lookup_table[MAX_NUMNODES];
int nr_cpus_in_node[MAX_NUMNODES] = { [0 ... (MAX_NUMNODES -1)] = 0};
......
......@@ -28,7 +28,8 @@ extern int nr_cpus_in_node[];
#define MEMORY_INCREMENT_SHIFT 28
#define MEMORY_INCREMENT (1UL << MEMORY_INCREMENT_SHIFT)
#define DEBUG_NUMA
/* NUMA debugging, will not work on a DLPAR machine */
#undef DEBUG_NUMA
static inline int pa_to_nid(unsigned long pa)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment