From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754548AbcJNLzC (ORCPT ); Fri, 14 Oct 2016 07:55:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:49948 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754498AbcJNLyz (ORCPT ); Fri, 14 Oct 2016 07:54:55 -0400 Date: Fri, 14 Oct 2016 13:54:46 +0200 From: Borislav Petkov To: Michael Ellerman Cc: akpm@osdl.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, peterz@infradead.org, jgross@suse.com, mgorman@techsingularity.net, richard@nod.at, len.brown@intel.com, boris.ostrovsky@oracle.com, tim.c.chen@linux.intel.com, ak@linux.intel.com, jolsa@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] kernel/smp: Make the SMP boot message common on all arches Message-ID: <20161014115446.gowu4r3aereixwz7@pd.tnic> References: <1476348920-15066-1-git-send-email-mpe@ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1476348920-15066-1-git-send-email-mpe@ellerman.id.au> User-Agent: NeoMutt/ (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 13, 2016 at 07:55:19PM +1100, Michael Ellerman wrote: > 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(). > > Signed-off-by: Michael Ellerman > --- > arch/x86/kernel/smpboot.c | 8 -------- > kernel/smp.c | 11 +++++------ > 2 files changed, 5 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > index 42a93621f5b0..7eb8dfa56d34 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) > return (send_status | accept_status); > } > > -void smp_announce(void) > -{ > - int num_nodes = num_online_nodes(); > - > - printk(KERN_INFO "x86: Booted up %d node%s, %d CPUs\n", > - num_nodes, (num_nodes > 1 ? "s" : ""), num_online_cpus()); > -} > - > /* reduce the number of lines printed when booting a large cpu count system */ > static void announce_cpu(int cpu, int apicid) > { > diff --git a/kernel/smp.c b/kernel/smp.c > index bba3b201668d..6f5696d260c8 100644 > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -543,15 +543,11 @@ void __init setup_nr_cpu_ids(void) > nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; > } > > -void __weak smp_announce(void) > -{ > - printk(KERN_INFO "Brought up %d CPUs\n", num_online_cpus()); > -} > - > /* Called by boot processor to activate the rest. */ > void __init smp_init(void) > { > unsigned int cpu; > + int num_nodes; > > idle_threads_init(); > cpuhp_threads_init(); > @@ -564,8 +560,11 @@ void __init smp_init(void) > cpu_up(cpu); > } > > + num_nodes = num_online_nodes(); > + pr_info("smp: Brought up %d node%s, %d CPUs\n", > + num_nodes, (num_nodes > 1 ? "s" : ""), num_online_cpus()); Please define pr_fmt for this file so that pr_info adds the prefix automatically. I guess #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt at the top, before all the include directives should suffice. Other than that, for both patches: Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --