Commit ef4423ce authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

s390/numa: only set possible nodes within node_possible_map

Make sure that only those nodes appear in the node_possible_map that
may actually be used. Usually that means that the node online and
possible maps are identical. For mode "plain" we only have one node,
for mode "emu" we have "emu_nodes" nodes.

Before this the possible map included (with default config) 16 nodes
while usually only one was used. That made a couple of loops that
iterated over all possible nodes do more work than necessary.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 88143091
...@@ -482,8 +482,12 @@ static int emu_setup_nodes_adjust(int nodes) ...@@ -482,8 +482,12 @@ static int emu_setup_nodes_adjust(int nodes)
*/ */
static void emu_setup(void) static void emu_setup(void)
{ {
int nid;
emu_size = emu_setup_size_adjust(emu_size); emu_size = emu_setup_size_adjust(emu_size);
emu_nodes = emu_setup_nodes_adjust(emu_nodes); emu_nodes = emu_setup_nodes_adjust(emu_nodes);
for (nid = 0; nid < emu_nodes; nid++)
node_set(nid, node_possible_map);
pr_info("Creating %d nodes with memory stripe size %ld MB\n", pr_info("Creating %d nodes with memory stripe size %ld MB\n",
emu_nodes, emu_size >> 20); emu_nodes, emu_size >> 20);
} }
......
...@@ -26,8 +26,14 @@ EXPORT_SYMBOL(node_data); ...@@ -26,8 +26,14 @@ EXPORT_SYMBOL(node_data);
cpumask_t node_to_cpumask_map[MAX_NUMNODES]; cpumask_t node_to_cpumask_map[MAX_NUMNODES];
EXPORT_SYMBOL(node_to_cpumask_map); EXPORT_SYMBOL(node_to_cpumask_map);
static void plain_setup(void)
{
node_set(0, node_possible_map);
}
const struct numa_mode numa_mode_plain = { const struct numa_mode numa_mode_plain = {
.name = "plain", .name = "plain",
.setup = plain_setup,
}; };
static const struct numa_mode *mode = &numa_mode_plain; static const struct numa_mode *mode = &numa_mode_plain;
...@@ -126,13 +132,13 @@ static void __init numa_setup_memory(void) ...@@ -126,13 +132,13 @@ static void __init numa_setup_memory(void)
void __init numa_setup(void) void __init numa_setup(void)
{ {
pr_info("NUMA mode: %s\n", mode->name); pr_info("NUMA mode: %s\n", mode->name);
nodes_clear(node_possible_map);
if (mode->setup) if (mode->setup)
mode->setup(); mode->setup();
numa_setup_memory(); numa_setup_memory();
memblock_dump_all(); memblock_dump_all();
} }
/* /*
* numa_init_early() - Initialization initcall * numa_init_early() - Initialization initcall
* *
......
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