aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2016-07-28 12:14:29 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-07-31 05:28:00 -0400
commitef4423ce70b8a78768a6e854e4d84c082800317d (patch)
treeeedd16f150f0baa440ed2e2db0841081586ed956
parent8814309163345830fa571fd8c153a8230b94db36 (diff)
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: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/numa/mode_emu.c4
-rw-r--r--arch/s390/numa/numa.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/arch/s390/numa/mode_emu.c b/arch/s390/numa/mode_emu.c
index fbc394e16b2c..37e0bb835516 100644
--- a/arch/s390/numa/mode_emu.c
+++ b/arch/s390/numa/mode_emu.c
@@ -482,8 +482,12 @@ static int emu_setup_nodes_adjust(int nodes)
482 */ 482 */
483static void emu_setup(void) 483static void emu_setup(void)
484{ 484{
485 int nid;
486
485 emu_size = emu_setup_size_adjust(emu_size); 487 emu_size = emu_setup_size_adjust(emu_size);
486 emu_nodes = emu_setup_nodes_adjust(emu_nodes); 488 emu_nodes = emu_setup_nodes_adjust(emu_nodes);
489 for (nid = 0; nid < emu_nodes; nid++)
490 node_set(nid, node_possible_map);
487 pr_info("Creating %d nodes with memory stripe size %ld MB\n", 491 pr_info("Creating %d nodes with memory stripe size %ld MB\n",
488 emu_nodes, emu_size >> 20); 492 emu_nodes, emu_size >> 20);
489} 493}
diff --git a/arch/s390/numa/numa.c b/arch/s390/numa/numa.c
index 2794845061c6..f576f1073378 100644
--- a/arch/s390/numa/numa.c
+++ b/arch/s390/numa/numa.c
@@ -26,8 +26,14 @@ EXPORT_SYMBOL(node_data);
26cpumask_t node_to_cpumask_map[MAX_NUMNODES]; 26cpumask_t node_to_cpumask_map[MAX_NUMNODES];
27EXPORT_SYMBOL(node_to_cpumask_map); 27EXPORT_SYMBOL(node_to_cpumask_map);
28 28
29static void plain_setup(void)
30{
31 node_set(0, node_possible_map);
32}
33
29const struct numa_mode numa_mode_plain = { 34const struct numa_mode numa_mode_plain = {
30 .name = "plain", 35 .name = "plain",
36 .setup = plain_setup,
31}; 37};
32 38
33static const struct numa_mode *mode = &numa_mode_plain; 39static const struct numa_mode *mode = &numa_mode_plain;
@@ -126,13 +132,13 @@ static void __init numa_setup_memory(void)
126void __init numa_setup(void) 132void __init numa_setup(void)
127{ 133{
128 pr_info("NUMA mode: %s\n", mode->name); 134 pr_info("NUMA mode: %s\n", mode->name);
135 nodes_clear(node_possible_map);
129 if (mode->setup) 136 if (mode->setup)
130 mode->setup(); 137 mode->setup();
131 numa_setup_memory(); 138 numa_setup_memory();
132 memblock_dump_all(); 139 memblock_dump_all();
133} 140}
134 141
135
136/* 142/*
137 * numa_init_early() - Initialization initcall 143 * numa_init_early() - Initialization initcall
138 * 144 *