Skip to content

Commit

Permalink
powerpc/numa: Print debug statements only when required
Browse files Browse the repository at this point in the history
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 <srikar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210826100521.412639-4-srikar@linux.vnet.ibm.com
  • Loading branch information
Srikar Dronamraju authored and Michael Ellerman committed Aug 26, 2021
1 parent 506c207 commit 544a09e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,20 @@ static void map_cpu_to_node(int cpu, int 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])))
if (!(cpumask_test_cpu(cpu, node_to_cpumask_map[node]))) {
pr_debug("adding cpu %d to node %d\n", cpu, node);
cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
}
}

#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR)
static void unmap_cpu_from_node(unsigned long 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])) {
cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
pr_debug("removing cpu %lu from node %d\n", cpu, node);
} else {
pr_warn("Warning: cpu %lu not found in node %d\n", cpu, node);
}
Expand Down

0 comments on commit 544a09e

Please sign in to comment.