Commit 0d015324 authored by Daniel Yeisley's avatar Daniel Yeisley Committed by Linus Torvalds

[PATCH] x86_64: Handle empty node zero

From: Daniel Yeisley <dan.yeisley@unisys.com>

It is possible to boot a Unisys ES7000 with CPUs from multiple cells, and not
also include the memory from those cells.  This can create a scenario where
node 0 has cpus, but no associated memory.  The system will boot fine in a
configuration where node 0 has memory, but nodes 2 and 3 do not.

[AK: I rechecked the code and generic code seems to indeed handle that already.
Dan's original patch had a change for mm/slab.c that seems to be already in now.]
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b2468e52
...@@ -54,6 +54,10 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order) ...@@ -54,6 +54,10 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
else else
#endif #endif
node = numa_node_id(); node = numa_node_id();
if (node < first_node(node_online_map))
node = first_node(node_online_map);
page = alloc_pages_node(node, gfp, order); page = alloc_pages_node(node, gfp, order);
return page ? page_address(page) : NULL; return page ? page_address(page) : NULL;
} }
......
...@@ -1051,7 +1051,7 @@ static void srat_detect_node(void) ...@@ -1051,7 +1051,7 @@ static void srat_detect_node(void)
for now. */ for now. */
node = apicid_to_node[hard_smp_processor_id()]; node = apicid_to_node[hard_smp_processor_id()];
if (node == NUMA_NO_NODE) if (node == NUMA_NO_NODE)
node = 0; node = first_node(node_online_map);
numa_set_node(cpu, node); numa_set_node(cpu, node);
if (acpi_numa > 0) if (acpi_numa > 0)
......
...@@ -399,8 +399,10 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) ...@@ -399,8 +399,10 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
/* First clean up the node list */ /* First clean up the node list */
for (i = 0; i < MAX_NUMNODES; i++) { for (i = 0; i < MAX_NUMNODES; i++) {
cutoff_node(i, start, end); cutoff_node(i, start, end);
if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
unparse_node(i); unparse_node(i);
node_set_offline(i);
}
} }
if (acpi_numa <= 0) if (acpi_numa <= 0)
......
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