linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.5] smp_init 'CPUS done' looks strange
@ 2002-11-13  3:50 Zwane Mwaikambo
  2002-11-13  9:34 ` Rusty Russell
  0 siblings, 1 reply; 4+ messages in thread
From: Zwane Mwaikambo @ 2002-11-13  3:50 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds, Rusty Russell

Also, it would make sense in the future if smp_cpus_done actually gets a 
value denoting how many cpus are online.

	Zwane

Index: linux-2.5.47/init/main.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.47/init/main.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 main.c
--- linux-2.5.47/init/main.c	11 Nov 2002 03:59:33 -0000	1.1.1.1
+++ linux-2.5.47/init/main.c	13 Nov 2002 03:47:56 -0000
@@ -347,8 +347,8 @@
 	}
 
 	/* Any cleanup work */
-	printk("CPUS done %u\n", max_cpus);
-	smp_cpus_done(max_cpus);
+	printk("CPUS done %u\n", num_online_cpus());
+	smp_cpus_done(num_online_cpus());
 #if 0
 	/* Get other processors into their bootup holding patterns. */
 

-- 
function.linuxpower.ca


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

* Re: [PATCH][2.5] smp_init 'CPUS done' looks strange
  2002-11-13  3:50 [PATCH][2.5] smp_init 'CPUS done' looks strange Zwane Mwaikambo
@ 2002-11-13  9:34 ` Rusty Russell
  2002-11-13 13:22   ` Zwane Mwaikambo
  0 siblings, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2002-11-13  9:34 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel, Linus Torvalds

In message <Pine.LNX.4.44.0211122246540.24523-100000@montezuma.mastecende.com> 
you write:
> Also, it would make sense in the future if smp_cpus_done actually gets a 
> value denoting how many cpus are online.

No.  Drop the prink by all means, but smp_cpus_done() can call
num_online_cpus() itself.  It can't know how many cpus the user
specified, however.

Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

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

* Re: [PATCH][2.5] smp_init 'CPUS done' looks strange
  2002-11-13  9:34 ` Rusty Russell
@ 2002-11-13 13:22   ` Zwane Mwaikambo
  2002-11-14  1:59     ` Rusty Russell
  0 siblings, 1 reply; 4+ messages in thread
From: Zwane Mwaikambo @ 2002-11-13 13:22 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Linux Kernel, Linus Torvalds

On Wed, 13 Nov 2002, Rusty Russell wrote:

> In message <Pine.LNX.4.44.0211122246540.24523-100000@montezuma.mastecende.com> 
> you write:
> > Also, it would make sense in the future if smp_cpus_done actually gets a 
> > value denoting how many cpus are online.
> 
> No.  Drop the prink by all means, but smp_cpus_done() can call
> num_online_cpus() itself.  It can't know how many cpus the user
> specified, however.

Doesn't that just encourage more (i = 0; i < NR_CPUS; i++) usage? If you 
make max_cpus available to everyone, at least they'll have the correct cpu 
count to check against. max_cpus is needed by more than bootup.

	Zwane
-- 
function.linuxpower.ca


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

* Re: [PATCH][2.5] smp_init 'CPUS done' looks strange
  2002-11-13 13:22   ` Zwane Mwaikambo
@ 2002-11-14  1:59     ` Rusty Russell
  0 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2002-11-14  1:59 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel, Linus Torvalds

In message <Pine.LNX.4.44.0211130820410.24523-100000@montezuma.mastecende.com> 
you write:
> On Wed, 13 Nov 2002, Rusty Russell wrote:
> 
> > In message <Pine.LNX.4.44.0211122246540.24523-100000@montezuma.mastecende.c
om> 
> > you write:
> > > Also, it would make sense in the future if smp_cpus_done actually gets a 
> > > value denoting how many cpus are online.
> > 
> > No.  Drop the prink by all means, but smp_cpus_done() can call
> > num_online_cpus() itself.  It can't know how many cpus the user
> > specified, however.
> 
> Doesn't that just encourage more (i = 0; i < NR_CPUS; i++) usage? If you 
> make max_cpus available to everyone, at least they'll have the correct cpu 
> count to check against. max_cpus is needed by more than bootup.

1) CPUs can be nonlinear.
2) They can bring CPUs up after boot.

AM has some cpu iterator patches for those who really care about
efficiently iterating over only online cpus, or only possible cpus.

Hope that helps,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

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

end of thread, other threads:[~2002-11-14  1:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-13  3:50 [PATCH][2.5] smp_init 'CPUS done' looks strange Zwane Mwaikambo
2002-11-13  9:34 ` Rusty Russell
2002-11-13 13:22   ` Zwane Mwaikambo
2002-11-14  1:59     ` Rusty Russell

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).