Skip to content

Commit 544a09e

Browse files
srikardmpe
authored andcommitted
powerpc/numa: Print debug statements only when required
Currently, a debug message gets printed every time an attempt to add(remove) a CPU. However this is redundant if the CPU is already added (removed) from the node. Signed-off-by: Srikar Dronamraju <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 506c207 commit 544a09e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

arch/powerpc/mm/numa.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,20 @@ static void map_cpu_to_node(int cpu, int node)
146146
{
147147
update_numa_cpu_lookup_table(cpu, node);
148148

149-
pr_debug("adding cpu %d to node %d\n", cpu, node);
150-
151-
if (!(cpumask_test_cpu(cpu, node_to_cpumask_map[node])))
149+
if (!(cpumask_test_cpu(cpu, node_to_cpumask_map[node]))) {
150+
pr_debug("adding cpu %d to node %d\n", cpu, node);
152151
cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
152+
}
153153
}
154154

155155
#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR)
156156
static void unmap_cpu_from_node(unsigned long cpu)
157157
{
158158
int node = numa_cpu_lookup_table[cpu];
159159

160-
pr_debug("removing cpu %lu from node %d\n", cpu, node);
161-
162160
if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
163161
cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
162+
pr_debug("removing cpu %lu from node %d\n", cpu, node);
164163
} else {
165164
pr_warn("Warning: cpu %lu not found in node %d\n", cpu, node);
166165
}

0 commit comments

Comments
 (0)