Commit 3339493f authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86-64: Fix empty nodes handling with SRAT

Handle empty nodes in SRAT parsing. Avoids an oops at boot time.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0cf42c31
...@@ -28,7 +28,6 @@ bootmem_data_t plat_node_bdata[MAX_NUMNODES]; ...@@ -28,7 +28,6 @@ bootmem_data_t plat_node_bdata[MAX_NUMNODES];
int memnode_shift; int memnode_shift;
u8 memnodemap[NODEMAPSIZE]; u8 memnodemap[NODEMAPSIZE];
#define NUMA_NO_NODE 0xff
unsigned char cpu_to_node[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE }; unsigned char cpu_to_node[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE };
cpumask_t node_to_cpumask[MAX_NUMNODES]; cpumask_t node_to_cpumask[MAX_NUMNODES];
......
...@@ -177,10 +177,18 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) ...@@ -177,10 +177,18 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
if (!node_isset(i, nodes_parsed)) if (!node_isset(i, nodes_parsed))
continue; continue;
cutoff_node(i, start, end); cutoff_node(i, start, end);
if (nodes[i].start == nodes[i].end) if (nodes[i].start == nodes[i].end) {
node_clear(i, nodes_parsed);
continue; continue;
}
setup_node_bootmem(i, nodes[i].start, nodes[i].end); setup_node_bootmem(i, nodes[i].start, nodes[i].end);
} }
for (i = 0; i < NR_CPUS; i++) {
if (cpu_to_node[i] == NUMA_NO_NODE)
continue;
if (!node_isset(cpu_to_node[i], nodes_parsed))
cpu_to_node[i] = NUMA_NO_NODE;
}
numa_init_array(); numa_init_array();
return 0; return 0;
} }
......
...@@ -16,4 +16,6 @@ extern void numa_add_cpu(int cpu); ...@@ -16,4 +16,6 @@ extern void numa_add_cpu(int cpu);
extern void numa_init_array(void); extern void numa_init_array(void);
extern int numa_off; extern int numa_off;
#define NUMA_NO_NODE 0xff
#endif #endif
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