linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>
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, bp@suse.de, 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
Date: Sun, 16 Oct 2016 09:04:06 +0200	[thread overview]
Message-ID: <20161016070406.GA4211@gmail.com> (raw)
In-Reply-To: <1476348920-15066-1-git-send-email-mpe@ellerman.id.au>


* Michael Ellerman <mpe@ellerman.id.au> 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 <mpe@ellerman.id.au>
> ---
>  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());

No objections - but pedantry requires me to mention that while we are evolving 
this code and changing the strings I think we should make the CPU announcement 
CPU%s smart as well: an SMP kernel on a single CPU bootup will result in 
num_online_cpus() == 1, right?

Thanks,

	Ingo

  parent reply	other threads:[~2016-10-16  7:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13  8:55 [PATCH 1/2] kernel/smp: Make the SMP boot message common on all arches Michael Ellerman
2016-10-13  8:55 ` [PATCH 2/2] kernel/smp: Tell the user we're bringing up secondary CPUs Michael Ellerman
2016-10-14 11:54 ` [PATCH 1/2] kernel/smp: Make the SMP boot message common on all arches Borislav Petkov
2016-10-26  5:32   ` Michael Ellerman
2016-10-16  7:04 ` Ingo Molnar [this message]
2016-10-26  5:34   ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161016070406.GA4211@gmail.com \
    --to=mingo@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=akpm@osdl.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jolsa@redhat.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).