Commit 544a09ee authored by Srikar Dronamraju's avatar Srikar Dronamraju Committed by Michael Ellerman

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: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210826100521.412639-4-srikar@linux.vnet.ibm.com
parent 506c2075
...@@ -146,10 +146,10 @@ static void map_cpu_to_node(int cpu, int node) ...@@ -146,10 +146,10 @@ static void map_cpu_to_node(int cpu, int node)
{ {
update_numa_cpu_lookup_table(cpu, node); update_numa_cpu_lookup_table(cpu, node);
pr_debug("adding cpu %d to node %d\n", cpu, node); if (!(cpumask_test_cpu(cpu, node_to_cpumask_map[node]))) {
pr_debug("adding cpu %d to node %d\n", cpu, node);
if (!(cpumask_test_cpu(cpu, node_to_cpumask_map[node])))
cpumask_set_cpu(cpu, node_to_cpumask_map[node]); cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
}
} }
#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR) #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR)
...@@ -157,10 +157,9 @@ static void unmap_cpu_from_node(unsigned long cpu) ...@@ -157,10 +157,9 @@ static void unmap_cpu_from_node(unsigned long cpu)
{ {
int node = numa_cpu_lookup_table[cpu]; int node = numa_cpu_lookup_table[cpu];
pr_debug("removing cpu %lu from node %d\n", cpu, node);
if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) { if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
cpumask_clear_cpu(cpu, node_to_cpumask_map[node]); cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
pr_debug("removing cpu %lu from node %d\n", cpu, node);
} else { } else {
pr_warn("Warning: cpu %lu not found in node %d\n", cpu, node); pr_warn("Warning: cpu %lu not found in node %d\n", cpu, node);
} }
......
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