linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86, smpboot: fix announce_cpu() to print the last OK
@ 2013-09-05 10:57 Libin
  2013-09-05 17:52 ` [tip:x86/urgent] x86/smpboot: Fix announce_cpu() to printk() the last "OK" properly tip-bot for Libin
  0 siblings, 1 reply; 46+ messages in thread
From: Libin @ 2013-09-05 10:57 UTC (permalink / raw)
  To: tglx, mingo, hpa, fenghua.yu, paul.gortmaker
  Cc: linux-kernel, guohanjun, wangyijing

When booting cpu, announce_cpu() is called to show which cpu is up
as following:
[    0.402751] smpboot: Booting Node   0, Processors  #1 #2 #3 #4 #5 OK
[    0.525667] smpboot: Booting Node   1, Processors  #6 #7 #8 #9 #10 #11 OK
[    0.755592] smpboot: Booting Node   0, Processors  #12 #13 #14 #15 #16 #17 OK
[    0.890495] smpboot: Booting Node   1, Processors  #18 #19 #20 #21 #22 #23
But the last OK is lost, because 'nr_cpu_ids-1' represents the maxinum possible
cpu id. It should use the maxinum present cpu id.

Signed-off-by: Libin <huawei.libin@huawei.com>
---
 arch/x86/kernel/smpboot.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index aecc98a..549b8cb 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -653,6 +653,8 @@ static void announce_cpu(int cpu, int apicid)
 {
 	static int current_node = -1;
 	int node = early_cpu_to_node(cpu);
+	int max_cpu_present =
+	    find_last_bit(cpumask_bits(cpu_present_mask), NR_CPUS);
 
 	if (system_state == SYSTEM_BOOTING) {
 		if (node != current_node) {
@@ -661,7 +663,7 @@ static void announce_cpu(int cpu, int apicid)
 			current_node = node;
 			pr_info("Booting Node %3d, Processors ", node);
 		}
-		pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " OK\n" : "");
+		pr_cont(" #%d%s", cpu, cpu == max_cpu_present ? " OK\n" : "");
 		return;
 	} else
 		pr_info("Booting Node %d Processor %d APIC 0x%x\n",
-- 
1.8.2.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2013-10-02 13:55 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05 10:57 [PATCH] x86, smpboot: fix announce_cpu() to print the last OK Libin
2013-09-05 17:52 ` [tip:x86/urgent] x86/smpboot: Fix announce_cpu() to printk() the last "OK" properly tip-bot for Libin
2013-09-25 10:07   ` Borislav Petkov
2013-09-25 18:29     ` Ingo Molnar
2013-09-26 23:15       ` Borislav Petkov
2013-09-27  6:51         ` Ingo Molnar
2013-09-27 10:38           ` Borislav Petkov
2013-09-27 14:32             ` Borislav Petkov
2013-09-27 14:34               ` [PATCH 1/2] x86, alternatives: Drop ancient lockdep fixup message Borislav Petkov
2013-09-28  8:28                 ` [tip:core/locking] lockdep, x86/alternatives: " tip-bot for Borislav Petkov
2013-09-27 14:35               ` [PATCH 2/2] x86: Cleanup boot CPUs table Borislav Petkov
2013-09-28  8:25                 ` Ingo Molnar
2013-09-28 10:23                   ` Borislav Petkov
2013-09-28 13:44                     ` Ingo Molnar
2013-09-28 17:47                       ` [PATCH] x86, boot: Further compress CPUs bootup message Borislav Petkov
2013-09-28 17:54                         ` Ingo Molnar
2013-09-28 18:04                           ` [PATCH -v1.1] " Borislav Petkov
2013-09-28 18:12                             ` Ingo Molnar
2013-09-28 19:15                               ` Borislav Petkov
2013-09-28 19:25                                 ` Ingo Molnar
2013-09-28 19:36                                   ` [PATCH -v1.3] " Borislav Petkov
2013-09-28 19:42                                   ` [PATCH -v1.1] " H. Peter Anvin
2013-09-28 19:49                                     ` Borislav Petkov
2013-09-28 19:54                                       ` Borislav Petkov
2013-09-28 19:58                                         ` Ingo Molnar
2013-09-28 20:08                                           ` Borislav Petkov
2013-09-28 23:13                                             ` H. Peter Anvin
2013-09-29  9:14                                               ` Borislav Petkov
2013-09-29 15:17                                                 ` [PATCH -v1.4] " Borislav Petkov
2013-09-29 15:44                                                 ` [PATCH -v1.1] " H. Peter Anvin
2013-09-30  6:28                                                   ` Ingo Molnar
2013-09-30  9:56                                                     ` Borislav Petkov
2013-10-01  8:53                                                       ` Ingo Molnar
2013-10-01  9:10                                                       ` [tip:x86/boot] x86/boot: " tip-bot for Borislav Petkov
2013-10-02 11:52                                                         ` Peter Zijlstra
2013-10-02 12:18                                                           ` Ingo Molnar
2013-10-02 12:20                                                           ` Peter Zijlstra
2013-10-02 13:55                                                             ` Borislav Petkov
2013-09-28 19:58                                     ` [PATCH -v1.1] x86, boot: " Ingo Molnar
2013-09-28 20:10                                       ` Borislav Petkov
2013-09-29  5:10                                         ` H. Peter Anvin
2013-09-29  2:55                   ` [PATCH 2/2] x86: Cleanup boot CPUs table Mike Galbraith
2013-09-28  8:28                 ` [tip:x86/boot] x86: Improve the printout of the SMP bootup CPU table tip-bot for Borislav Petkov
2013-09-29  4:25                   ` Yinghai Lu
2013-09-27 12:48           ` [tip:x86/urgent] x86/smpboot: Fix announce_cpu() to printk() the last "OK" properly Borislav Petkov
2013-09-27 13:33             ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).