public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Correct CPUs printout on boot.
@ 2004-01-23  6:35 davej
  2004-01-23 23:03 ` Eric
  0 siblings, 1 reply; 3+ messages in thread
From: davej @ 2004-01-23  6:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, akpm

This currently prints out the maximum number of CPUs the
kernel is configured to support, instead of the actual
number that the kernel brought up. Which results in odd
displays that look like you have more CPUs than you do.

    Dave

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/init/main.c linux-2.5/init/main.c
--- linux-2.5/init/main.c~	Fri Jan 23 06:24:12 2004
+++ linux-2.5/init/main.c	Fri Jan 23 06:24:44 2004
@@ -339,7 +339,7 @@
 /* Called by boot processor to activate the rest. */
 static void __init smp_init(void)
 {
-	unsigned int i;
+	unsigned int i, j=0;
 
 	/* FIXME: This should be done in userspace --RR */
 	for (i = 0; i < NR_CPUS; i++) {
@@ -348,11 +348,12 @@
 		if (cpu_possible(i) && !cpu_online(i)) {
 			printk("Bringing up %i\n", i);
 			cpu_up(i);
+			j++;
 		}
 	}
 
 	/* Any cleanup work */
-	printk("CPUS done %u\n", max_cpus);
+	printk("CPUS done %u\n", j);
 	smp_cpus_done(max_cpus);
 #if 0
 	/* Get other processors into their bootup holding patterns. */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Correct CPUs printout on boot.
  2004-01-23  6:35 Correct CPUs printout on boot davej
@ 2004-01-23 23:03 ` Eric
  2004-01-24  2:25   ` Nick Piggin
  0 siblings, 1 reply; 3+ messages in thread
From: Eric @ 2004-01-23 23:03 UTC (permalink / raw)
  To: linux-kernel, davej

On Friday 23 January 2004 12:35 am, davej@redhat.com wrote:
> This currently prints out the maximum number of CPUs the
> kernel is configured to support, instead of the actual
> number that the kernel brought up. Which results in odd
> displays that look like you have more CPUs than you do.

Why do you have to declare a new variable? Can't you just do this? i is 
already counting how many cpu's we've brought up and its of the same type j.

-	printk("CPUS done %u\n", max_cpus);
+	printk("CPUS done %u\n", i);


>     Dave
>
> diff -urpN --exclude-from=/home/davej/.exclude bk-linus/init/main.c
> linux-2.5/init/main.c --- linux-2.5/init/main.c~	Fri Jan 23 06:24:12 2004
> +++ linux-2.5/init/main.c	Fri Jan 23 06:24:44 2004
> @@ -339,7 +339,7 @@
>  /* Called by boot processor to activate the rest. */
>  static void __init smp_init(void)
>  {
> -	unsigned int i;
> +	unsigned int i, j=0;
>
>  	/* FIXME: This should be done in userspace --RR */
>  	for (i = 0; i < NR_CPUS; i++) {
> @@ -348,11 +348,12 @@
>  		if (cpu_possible(i) && !cpu_online(i)) {
>  			printk("Bringing up %i\n", i);
>  			cpu_up(i);
> +			j++;
>  		}
>  	}
>
>  	/* Any cleanup work */
> -	printk("CPUS done %u\n", max_cpus);
> +	printk("CPUS done %u\n", j);
>  	smp_cpus_done(max_cpus);
>  #if 0
>  	/* Get other processors into their bootup holding patterns. */

 
-------------------------
Eric Bambach
Eric at cisu dot net
-------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Correct CPUs printout on boot.
  2004-01-23 23:03 ` Eric
@ 2004-01-24  2:25   ` Nick Piggin
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Piggin @ 2004-01-24  2:25 UTC (permalink / raw)
  To: Eric; +Cc: linux-kernel, davej



Eric wrote:

>On Friday 23 January 2004 12:35 am, davej@redhat.com wrote:
>
>>This currently prints out the maximum number of CPUs the
>>kernel is configured to support, instead of the actual
>>number that the kernel brought up. Which results in odd
>>displays that look like you have more CPUs than you do.
>>
>
>Why do you have to declare a new variable? Can't you just do this? i is 
>already counting how many cpu's we've brought up and its of the same type j.
>

CPU numbering is allowed to be sparse. Besides, i still
counts up to NR_CPUS even if CPU numbering isn't sparse.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-24  2:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-23  6:35 Correct CPUs printout on boot davej
2004-01-23 23:03 ` Eric
2004-01-24  2:25   ` Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox