Skip to contentSkip to conversation

powerpc/numa: Correct kernel message severity

PATCH In review Vipin K Parashar 3 participants 4 messages Mar 14, 2018 – Jun 22, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/numa: Correct kernel message severity

printk() in unmap_cpu_from_node() uses KERN_ERR message severity, for a WARNING message. Change it to pr_warn().

---
 arch/powerpc/mm/numa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/mm/numa.c +1 -2
index edd8d0b..1632f4b 100644
@@ -163,8 +163,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
 	if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
 		cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
 	} else {
-		printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n",
-		       cpu, node);
+		pr_warn("WARNING: cpu %lu not found in node %d\n", cpu, node);
 	}
 }
 #endif /* CONFIG_HOTPLUG_CPU || CONFIG_PPC_SPLPAR */
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw

Le 14/03/2018 à 08:52, Vipin K Parashar a écrit :

Quoted 4 lines

printk() in unmap_cpu_from_node() uses KERN_ERR message severity, for a WARNING message. Change it to pr_warn().

Quoted 19 lines
---
  arch/powerpc/mm/numa.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/mm/numa.c +1 -2
index edd8d0b..1632f4b 100644
@@ -163,8 +163,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
  	if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
  		cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
  	} else {
-		printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n",
-		       cpu, node);
+		pr_warn("WARNING: cpu %lu not found in node %d\n", cpu, node);
  	}
  }
  #endif /* CONFIG_HOTPLUG_CPU || CONFIG_PPC_SPLPAR */
#2 lore raw
In reply to Vipin K Parashar

Hi,

Any progress/update with this patch ?

Please do let know, if something more is needed here.

Regards,

Vipin

Quoted 22 lines · Vipin K Parashar

printk() in unmap_cpu_from_node() uses KERN_ERR message severity, for a WARNING message. Change it to pr_warn().

---
  arch/powerpc/mm/numa.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/mm/numa.c +1 -2
index edd8d0b..1632f4b 100644
@@ -163,8 +163,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
  	if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
  		cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
  	} else {
-		printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n",
-		       cpu, node);
+		pr_warn("WARNING: cpu %lu not found in node %d\n", cpu, node);
  	}
  }
  #endif /* CONFIG_HOTPLUG_CPU || CONFIG_PPC_SPLPAR */
#3 lore raw
In reply to Vipin K Parashar
Quoted 13 lines · Vipin K Parashar

printk() in unmap_cpu_from_node() uses KERN_ERR message severity, for a WARNING message. Change it to pr_warn().

---
 arch/powerpc/mm/numa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/mm/numa.c +0 -0
index edd8d0b..1632f4b 100644

arch/powerpc/mm/numa.c static void unmap_cpu_from_node(unsigned long cpu) · line 168

Quoted 8 lines
arch/powerpc/mm/numa.c +1 -2
@@ -163,8 +163,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
 	if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
 		cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
 	} else {
-		printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n",
-		       cpu, node);
+		pr_warn("WARNING: cpu %lu not found in node %d\n", cpu, node);
 	}
 }

The full function is:

static void unmap_cpu_from_node(unsigned long cpu)

{
	int node = numa_cpu_lookup_table[cpu];

	dbg("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]);
	} else {
		printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n",
		       cpu, node);
	}
}

So we look up what node the CPU is on, and then we lookup the set of CPUs on that node, and they don't match.

That seems like a bug, not a warning.

Have you looked at why we're seeing this warning? It seems like maybe something else is going wrong to get us into this situation to begin with.

If there's some good reason why this is happening, and it's truly harmless, then we can just remove the printk() entirely.

cheers