Skip to content

Commit ef4423c

Browse files
heicarstMartin Schwidefsky
authored andcommitted
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>
1 parent 8814309 commit ef4423c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

arch/s390/numa/mode_emu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,12 @@ static int emu_setup_nodes_adjust(int nodes)
482482
*/
483483
static void emu_setup(void)
484484
{
485+
int nid;
486+
485487
emu_size = emu_setup_size_adjust(emu_size);
486488
emu_nodes = emu_setup_nodes_adjust(emu_nodes);
489+
for (nid = 0; nid < emu_nodes; nid++)
490+
node_set(nid, node_possible_map);
487491
pr_info("Creating %d nodes with memory stripe size %ld MB\n",
488492
emu_nodes, emu_size >> 20);
489493
}

arch/s390/numa/numa.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ EXPORT_SYMBOL(node_data);
2626
cpumask_t node_to_cpumask_map[MAX_NUMNODES];
2727
EXPORT_SYMBOL(node_to_cpumask_map);
2828

29+
static void plain_setup(void)
30+
{
31+
node_set(0, node_possible_map);
32+
}
33+
2934
const struct numa_mode numa_mode_plain = {
3035
.name = "plain",
36+
.setup = plain_setup,
3137
};
3238

3339
static const struct numa_mode *mode = &numa_mode_plain;
@@ -126,13 +132,13 @@ static void __init numa_setup_memory(void)
126132
void __init numa_setup(void)
127133
{
128134
pr_info("NUMA mode: %s\n", mode->name);
135+
nodes_clear(node_possible_map);
129136
if (mode->setup)
130137
mode->setup();
131138
numa_setup_memory();
132139
memblock_dump_all();
133140
}
134141

135-
136142
/*
137143
* numa_init_early() - Initialization initcall
138144
*

0 commit comments

Comments
 (0)