smpboot: CPU numbers printed as warning

From: Paul Menzel
Date: Mon Feb 15 2021 - 14:23:23 EST


Dear Linux folks,


Using Linux 5.10.13 (and before), looking at the Linux kernel warnings, the CPU numbers show up. For example with 12 cpus/threads:

```
$ sudo dmesg --level=warn
[ 0.216103] #2
[ 0.220105] #3
[ 0.224103] #4
[ 0.228104] #5
[ 0.232110] #6
[ 0.236101] #7
[ 0.240102] #8
[ 0.244102] #9
[ 0.248100] #10
[ 0.252098] #11
```

If I am not mistaken, this is from `announce_cpu()` in `arch/x86/kernel/smpboot.c`, and the `pr_cont()` in their “forgets” the log level it belongs to, maybe because of SMP and other messages are printed in between.

```
if (system_state < SYSTEM_RUNNING) {
if (node != current_node) {
if (current_node > (-1))
pr_cont("\n");
current_node = node;

printk(KERN_INFO ".... node %*s#%d, CPUs: ",
node_width - num_digits(node), " ", node);
}

/* Add padding for the BSP */
if (cpu == 1)
pr_cont("%*s", width + 1, " ");

pr_cont("%*s#%d", width - num_digits(cpu), " ", cpu);

} else
pr_info("Booting Node %d Processor %d APIC 0x%x\n",
node, cpu, apicid);
```

Would using `pr_info()` instead be an acceptable fix?


Kind regards,

Paul