diff options
-rw-r--r-- | arch/x86/kernel/smpboot.c | 24 | ||||
-rw-r--r-- | arch/x86/lib/misc.c | 20 | ||||
-rw-r--r-- | kernel/smp.c | 7 |
3 files changed, 40 insertions, 11 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index d41f3ba26ced..2a165580fa16 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -647,22 +647,38 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) | |||
647 | return (send_status | accept_status); | 647 | return (send_status | accept_status); |
648 | } | 648 | } |
649 | 649 | ||
650 | void smp_announce(void) | ||
651 | { | ||
652 | int num_nodes = num_online_nodes(); | ||
653 | |||
654 | printk(KERN_INFO "x86: Booted up %d node%s, %d CPUs\n", | ||
655 | num_nodes, (num_nodes > 1 ? "s" : ""), num_online_cpus()); | ||
656 | } | ||
657 | |||
650 | /* reduce the number of lines printed when booting a large cpu count system */ | 658 | /* reduce the number of lines printed when booting a large cpu count system */ |
651 | static void announce_cpu(int cpu, int apicid) | 659 | static void announce_cpu(int cpu, int apicid) |
652 | { | 660 | { |
653 | static int current_node = -1; | 661 | static int current_node = -1; |
654 | int node = early_cpu_to_node(cpu); | 662 | int node = early_cpu_to_node(cpu); |
655 | static int width; | 663 | static int width, node_width; |
656 | 664 | ||
657 | if (!width) | 665 | if (!width) |
658 | width = num_digits(num_possible_cpus()) + 1; /* + '#' sign */ | 666 | width = num_digits(num_possible_cpus()) + 1; /* + '#' sign */ |
659 | 667 | ||
668 | if (!node_width) | ||
669 | node_width = num_digits(num_possible_nodes()) + 1; /* + '#' */ | ||
670 | |||
671 | if (cpu == 1) | ||
672 | printk(KERN_INFO "x86: Booting SMP configuration:\n"); | ||
673 | |||
660 | if (system_state == SYSTEM_BOOTING) { | 674 | if (system_state == SYSTEM_BOOTING) { |
661 | if (node != current_node) { | 675 | if (node != current_node) { |
662 | if (current_node > (-1)) | 676 | if (current_node > (-1)) |
663 | pr_cont(" OK\n"); | 677 | pr_cont("\n"); |
664 | current_node = node; | 678 | current_node = node; |
665 | pr_info("Booting Node %3d, Processors:", node); | 679 | |
680 | printk(KERN_INFO ".... node %*s#%d, CPUs: ", | ||
681 | node_width - num_digits(node), " ", node); | ||
666 | } | 682 | } |
667 | 683 | ||
668 | /* Add padding for the BSP */ | 684 | /* Add padding for the BSP */ |
@@ -671,8 +687,6 @@ static void announce_cpu(int cpu, int apicid) | |||
671 | 687 | ||
672 | pr_cont("%*s#%d", width - num_digits(cpu), " ", cpu); | 688 | pr_cont("%*s#%d", width - num_digits(cpu), " ", cpu); |
673 | 689 | ||
674 | if (cpu == num_present_cpus() - 1) | ||
675 | pr_cont(" OK\n"); | ||
676 | } else | 690 | } else |
677 | pr_info("Booting Node %d Processor %d APIC 0x%x\n", | 691 | pr_info("Booting Node %d Processor %d APIC 0x%x\n", |
678 | node, cpu, apicid); | 692 | node, cpu, apicid); |
diff --git a/arch/x86/lib/misc.c b/arch/x86/lib/misc.c index bc35cde9769f..76b373af03f0 100644 --- a/arch/x86/lib/misc.c +++ b/arch/x86/lib/misc.c | |||
@@ -1,11 +1,21 @@ | |||
1 | /* | ||
2 | * Count the digits of @val including a possible sign. | ||
3 | * | ||
4 | * (Typed on and submitted from hpa's mobile phone.) | ||
5 | */ | ||
1 | int num_digits(int val) | 6 | int num_digits(int val) |
2 | { | 7 | { |
3 | int digits = 0; | 8 | int m = 10; |
9 | int d = 1; | ||
4 | 10 | ||
5 | while (val) { | 11 | if (val < 0) { |
6 | val /= 10; | 12 | d++; |
7 | digits++; | 13 | val = -val; |
8 | } | 14 | } |
9 | 15 | ||
10 | return digits; | 16 | while (val >= m) { |
17 | m *= 10; | ||
18 | d++; | ||
19 | } | ||
20 | return d; | ||
11 | } | 21 | } |
diff --git a/kernel/smp.c b/kernel/smp.c index 0564571dcdf7..f5768b0c816a 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
@@ -524,6 +524,11 @@ void __init setup_nr_cpu_ids(void) | |||
524 | nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; | 524 | nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; |
525 | } | 525 | } |
526 | 526 | ||
527 | void __weak smp_announce(void) | ||
528 | { | ||
529 | printk(KERN_INFO "Brought up %d CPUs\n", num_online_cpus()); | ||
530 | } | ||
531 | |||
527 | /* Called by boot processor to activate the rest. */ | 532 | /* Called by boot processor to activate the rest. */ |
528 | void __init smp_init(void) | 533 | void __init smp_init(void) |
529 | { | 534 | { |
@@ -540,7 +545,7 @@ void __init smp_init(void) | |||
540 | } | 545 | } |
541 | 546 | ||
542 | /* Any cleanup work */ | 547 | /* Any cleanup work */ |
543 | printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus()); | 548 | smp_announce(); |
544 | smp_cpus_done(setup_max_cpus); | 549 | smp_cpus_done(setup_max_cpus); |
545 | } | 550 | } |
546 | 551 | ||