Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Sep 2004 14:20:18 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Julian Elischer <julian@freebsd.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/amd64/amd64 mp_machdep.c src/sys/i386/i386 mp_machdep.c src/sys/i386/include param.h src/sys/kern kern_idle.c kern_switch.c sched_4bsd.c subr_smp.c src/sys/sys smp.h
Message-ID:  <20040901112017.GA43387@orion.daedalusnetworks.priv>
In-Reply-To: <200409010642.i816g2lK094069@repoman.freebsd.org>
References:  <200409010642.i816g2lK094069@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2004-09-01 06:42, Julian Elischer <julian@freebsd.org> wrote:

>   Give the 4bsd scheduler the ability to wake up idle processors
>   when there is new work to be done.

>   1.191     +135 -1    src/sys/kern/subr_smp.c

This moved all_cpus in an #ifdef SMP which breaks the compilation on
non-SPM systems:

: linking kernel.debug
: subr_smp.o(.text+0x1f): In function `mp_setvariables_for_up':
: /usr/src/sys/kern/subr_smp.c:498: undefined reference to `all_cpus'
: uma_core.o(.text+0x1ff): In function `zone_timeout':
: /usr/src/sys/vm/uma_core.c:384: undefined reference to `all_cpus'
: uma_core.o(.text+0x5e3): In function `cache_drain':
: /usr/src/sys/vm/uma_core.c:610: undefined reference to `all_cpus'
: uma_core.o(.text+0x6b3):/usr/src/sys/vm/uma_core.c:626: undefined reference to `all_cpus'
: uma_core.o(.text+0x2fcb): In function `uma_print_zone':
: /usr/src/sys/vm/uma_core.c:2660: undefined reference to `all_cpus'
: uma_core.o(.text+0x314b):/usr/src/sys/vm/uma_core.c:2712: more undefined references to `all_cpus' follow
: *** Error code 1
:
: Stop in /usr/obj/usr/src/sys/ORION.

If all_cpus is only meaningful in the #ifdef SMP case, the following
diff seems necessary to unbreak the build of HEAD on non-SMP systems:

%%%
Index: sys/smp.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/smp.h,v
retrieving revision 1.80
diff -u -r1.80 smp.h
--- sys/smp.h	1 Sep 2004 06:42:02 -0000	1.80
+++ sys/smp.h	1 Sep 2004 11:14:29 -0000
@@ -65,7 +65,11 @@
  * time, thus permitting us to configure sparse maps of cpuid-dependent
  * (per-CPU) structures.
  */
+#ifdef SMP
 #define	CPU_ABSENT(x_cpu)	((all_cpus & (1 << (x_cpu))) == 0)
+#else
+#define	CPU_ABSENT(x_cpu)	(0)
+#endif
 
 #ifdef SMP
 /*
Index: kern/subr_smp.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/subr_smp.c,v
retrieving revision 1.191
diff -u -r1.191 subr_smp.c
--- kern/subr_smp.c	1 Sep 2004 06:42:01 -0000	1.191
+++ kern/subr_smp.c	1 Sep 2004 11:12:38 -0000
@@ -495,7 +495,6 @@
 {
 	mp_ncpus = 1;
 	mp_maxid = PCPU_GET(cpuid);
-	all_cpus = PCPU_GET(cpumask);
 	KASSERT(PCPU_GET(cpuid) == 0, ("UP must have a CPU ID of zero"));
 }
 SYSINIT(cpu_mp_setvariables, SI_SUB_TUNABLES, SI_ORDER_FIRST,
%%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040901112017.GA43387>