The patch titled Subject: kernel/smp.c: make the SMP boot message common on all arches has been added to the -mm tree. Its filename is kernel-smp-make-the-smp-boot-message-common-on-all-arches.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kernel-smp-make-the-smp-boot-message-common-on-all-arches.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kernel-smp-make-the-smp-boot-message-common-on-all-arches.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Subject: kernel/smp.c: 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 Link: http://lkml.kernel.org/r/1477460275-8266-2-git-send-email-mpe@xxxxxxxxxxxxxx Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Reviewed-by: Borislav Petkov <bp@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: H. Peter Anvin <hpa@xxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Juergen Gross <jgross@xxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Richard Weinberger <richard@xxxxxx> Cc: Len Brown <len.brown@xxxxxxxxx> Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> Cc: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx> Cc: Jiri Olsa <jolsa@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/x86/kernel/smpboot.c | 8 -------- kernel/smp.c | 13 +++++++------ 2 files changed, 7 insertions(+), 14 deletions(-) diff -puN arch/x86/kernel/smpboot.c~kernel-smp-make-the-smp-boot-message-common-on-all-arches arch/x86/kernel/smpboot.c --- a/arch/x86/kernel/smpboot.c~kernel-smp-make-the-smp-boot-message-common-on-all-arches +++ a/arch/x86/kernel/smpboot.c @@ -821,14 +821,6 @@ wakeup_secondary_cpu_via_init(int phys_a 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 -puN kernel/smp.c~kernel-smp-make-the-smp-boot-message-common-on-all-arches kernel/smp.c --- a/kernel/smp.c~kernel-smp-make-the-smp-boot-message-common-on-all-arches +++ a/kernel/smp.c @@ -546,14 +546,10 @@ 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) { + int num_nodes, num_cpus; unsigned int cpu; idle_threads_init(); @@ -567,8 +563,13 @@ void __init smp_init(void) cpu_up(cpu); } + num_nodes = num_online_nodes(); + num_cpus = num_online_cpus(); + pr_info("Brought up %d node%s, %d CPU%s\n", + num_nodes, (num_nodes > 1 ? "s" : ""), + num_cpus, (num_cpus > 1 ? "s" : "")); + /* Any cleanup work */ - smp_announce(); smp_cpus_done(setup_max_cpus); } _ Patches currently in -mm which might be from mpe@xxxxxxxxxxxxxx are kernel-smp-define-pr_fmt-for-smpc.patch kernel-smp-make-the-smp-boot-message-common-on-all-arches.patch kernel-smp-tell-the-user-were-bringing-up-secondary-cpus.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html