public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Linux 2.5.23 cpu_online_map undeclared
@ 2002-06-19  3:14 John Weber
  2002-06-19  5:36 ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: John Weber @ 2002-06-19  3:14 UTC (permalink / raw)
  To: linux-kernel

I am running on a UP system, so I don't believe that cpu_online_map 
should be declared.  Any suggestions?

   gcc -Wp,-MD,./.sched.o.d -D__KERNEL__ -I/usr/src/linux-2.5.23/include 
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer 
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 
-march=i686 -nostdinc -iwithprefix include    -fno-omit-frame-pointer 
-DKBUILD_BASENAME=sched   -c -o sched.o sched.c
sched.c: In function `sys_sched_setaffinity':
sched.c:1332: `cpu_online_map' undeclared (first use in this function)
sched.c:1332: (Each undeclared identifier is reported only once
sched.c:1332: for each function it appears in.)
sched.c: In function `sys_sched_getaffinity':
sched.c:1391: `cpu_online_map' undeclared (first use in this function)
make[1]: *** [sched.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.5.23/kernel'
make: *** [kernel] Error 2


  -o)  J o h n   W e b e r
  /\\ john.weber@linuxhq.com
_\/v http://www.linuxhq.com/people/weber/


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

* Re: Linux 2.5.23 cpu_online_map undeclared
  2002-06-19  3:14 Linux 2.5.23 cpu_online_map undeclared John Weber
@ 2002-06-19  5:36 ` Linus Torvalds
  2002-06-19  6:38   ` Ingo Molnar
  2002-06-20 22:59   ` Rusty Russell
  0 siblings, 2 replies; 4+ messages in thread
From: Linus Torvalds @ 2002-06-19  5:36 UTC (permalink / raw)
  To: linux-kernel

In article <3D0FF715.7040601@linuxhq.com>,
John Weber  <john.weber@linuxhq.com> wrote:
>I am running on a UP system, so I don't believe that cpu_online_map 
>should be declared.  Any suggestions?

Actually, it _should_ be declared, it's just that on UP it should be
defined to the constant 1.

Somehow that #define got dropped by the hotplug-CPU stuff.

To fix, just add a

	#define cpu_online_map		1

to the non-SMP parts of include/linus/smp.h. The patch looks something
like the appended (totally untested) thing.

Does that make UP happier?

		Linus

--- 1.8/include/linux/smp.h	Mon Jun 17 23:25:22 2002
+++ edited/include/linux/smp.h	Tue Jun 18 22:30:47 2002
@@ -86,6 +86,7 @@
 #define smp_call_function(func,info,retry,wait)	({ 0; })
 static inline void smp_send_reschedule(int cpu) { }
 static inline void smp_send_reschedule_all(void) { }
+#define cpu_online_map				1
 #define cpu_online(cpu)				1
 #define num_online_cpus()			1
 #define __per_cpu_data

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

* Re: Linux 2.5.23 cpu_online_map undeclared
  2002-06-19  5:36 ` Linus Torvalds
@ 2002-06-19  6:38   ` Ingo Molnar
  2002-06-20 22:59   ` Rusty Russell
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2002-06-19  6:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel


On Wed, 19 Jun 2002, Linus Torvalds wrote:

>  static inline void smp_send_reschedule_all(void) { }
> +#define cpu_online_map				1
>  #define cpu_online(cpu)				1

yesterday i've tested a number of UP kernels that had an equivalent fix
and this works as expected, nothing else broke.

	Ingo


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

* Re: Linux 2.5.23 cpu_online_map undeclared
  2002-06-19  5:36 ` Linus Torvalds
  2002-06-19  6:38   ` Ingo Molnar
@ 2002-06-20 22:59   ` Rusty Russell
  1 sibling, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2002-06-20 22:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

On Wed, 19 Jun 2002 05:36:08 +0000 (UTC)
torvalds@transmeta.com (Linus Torvalds) wrote:

> Actually, it _should_ be declared, it's just that on UP it should be
> defined to the constant 1.
> 
> Somehow that #define got dropped by the hotplug-CPU stuff.

Actually, was deliberate.  Not exposing the mask when almost everyone
just wants to know "are any of these cpus online" was a preemptive strike
against NR_CPUS > BITS_PER_LONG (I wouldn't have bothered but I was so
close anyway).

My mistake was not noticing that x86 SMP was still exposing it and that
scheduler changes since my original patch were using it.  Fixed with
cpu_online_mask(res, mask) in prior patch.

Apologies, and hope that clarifies,
Rusty.
-- 
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy

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

end of thread, other threads:[~2002-06-20 22:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-19  3:14 Linux 2.5.23 cpu_online_map undeclared John Weber
2002-06-19  5:36 ` Linus Torvalds
2002-06-19  6:38   ` Ingo Molnar
2002-06-20 22: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