aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-10-26 01:37:54 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-10-26 06:02:35 -0400
commit92b23278298304f72bbc786a737f2646f4b9aa9d (patch)
tree5be322a3a02668ed3b4c80d8402b01d2ccdf211e
parentca7dfdbb33675151ad0854aea11340f95c38aff3 (diff)
kernel/smp: Make the SMP boot message common on all arches
Currently after bringing up secondary CPUs all arches print "Brought up %d CPUs". On x86 they also print the number of nodes that were brought online. It would be nice to also print the number of nodes on other arches. Although we could override smp_announce() on the other ~10 NUMA aware arches, it seems simpler to just always print the number of nodes. On non-NUMA arches there is just always 1 node. Having done that, smp_announce() is no longer weak, and seems small enough to just pull directly into smp_init(). Also update the printing of "%d CPUs" to be smart when an SMP kernel is booted on a single CPU system, or when only one CPU is available, eg: smp: Brought up 2 nodes, 1 CPU Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Borislav Petkov <bp@suse.de> Cc: akpm@osdl.org Cc: jgross@suse.com Cc: ak@linux.intel.com Cc: tim.c.chen@linux.intel.com Cc: len.brown@intel.com Cc: peterz@infradead.org Cc: richard@nod.at Cc: jolsa@redhat.com Cc: boris.ostrovsky@oracle.com Cc: mgorman@techsingularity.net Link: http://lkml.kernel.org/r/1477460275-8266-2-git-send-email-mpe@ellerman.id.au Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/kernel/smpboot.c8
-rw-r--r--kernel/smp.c13
2 files changed, 7 insertions, 14 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 42f5eb7b4f6c..b9f02383f372 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -821,14 +821,6 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
821 return (send_status | accept_status); 821 return (send_status | accept_status);
822} 822}
823 823
824void smp_announce(void)
825{
826 int num_nodes = num_online_nodes();
827
828 printk(KERN_INFO "x86: Booted up %d node%s, %d CPUs\n",
829 num_nodes, (num_nodes > 1 ? "s" : ""), num_online_cpus());
830}
831
832/* reduce the number of lines printed when booting a large cpu count system */ 824/* reduce the number of lines printed when booting a large cpu count system */
833static void announce_cpu(int cpu, int apicid) 825static void announce_cpu(int cpu, int apicid)
834{ 826{
diff --git a/kernel/smp.c b/kernel/smp.c
index 2d1f15d43022..4323c5db7d26 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -546,14 +546,10 @@ void __init setup_nr_cpu_ids(void)
546 nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; 546 nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
547} 547}
548 548
549void __weak smp_announce(void)
550{
551 printk(KERN_INFO "Brought up %d CPUs\n", num_online_cpus());
552}
553
554/* Called by boot processor to activate the rest. */ 549/* Called by boot processor to activate the rest. */
555void __init smp_init(void) 550void __init smp_init(void)
556{ 551{
552 int num_nodes, num_cpus;
557 unsigned int cpu; 553 unsigned int cpu;
558 554
559 idle_threads_init(); 555 idle_threads_init();
@@ -567,8 +563,13 @@ void __init smp_init(void)
567 cpu_up(cpu); 563 cpu_up(cpu);
568 } 564 }
569 565
566 num_nodes = num_online_nodes();
567 num_cpus = num_online_cpus();
568 pr_info("Brought up %d node%s, %d CPU%s\n",
569 num_nodes, (num_nodes > 1 ? "s" : ""),
570 num_cpus, (num_cpus > 1 ? "s" : ""));
571
570 /* Any cleanup work */ 572 /* Any cleanup work */
571 smp_announce();
572 smp_cpus_done(setup_max_cpus); 573 smp_cpus_done(setup_max_cpus);
573} 574}
574 575