Skip to contentSkip to conversation

fix generic build when CONFIG_SMP=n

PATCH In review Jesse Barnes 3 participants 5 messages Aug 13, 2004 – Aug 24, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix generic build when CONFIG_SMP=n

This patch fixes the issues I saw with CONFIG_SMP=n when building a generic kernel with CONFIG_NUMA=y and CONFIG_DISCONTIGMEM=y. It's still pretty rough, but I'd appreciate comments and testing on other platforms. The per-cpu fixes are still pretty ugly--I'm sure I'm missing something that would make abstracting out per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data much nicer looking.

Fixing the build of generic kernels w/o CONFIG_NUMA or CONFIG_DISCONTIGMEM is left as an exercise for the reader. :)

Thanks,
Jesse

arch/ia64/kernel/Makefile +1 -0
diff -Nru a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
@@ -15,6 +15,7 @@
 obj-$(CONFIG_IOSAPIC)		+= iosapic.o
 obj-$(CONFIG_MODULES)		+= module.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o
+obj-$(CONFIG_NUMA)		+= numa.o
 obj-$(CONFIG_PERFMON)		+= perfmon_default_smpl.o
 obj-$(CONFIG_IA64_CYCLONE)	+= cyclone.o
 
arch/ia64/kernel/acpi.c +3 -1
diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
@@ -618,8 +618,10 @@
 			if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
 				node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
 	}
-	build_cpu_to_node_map();
 # endif
+#endif
+#ifdef CONFIG_ACPI_NUMA
+	build_cpu_to_node_map();
 #endif
 	/* Make boot-up look pretty */
 	printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
arch/ia64/kernel/numa.c new file +57 -0

57 lines not on this page · raw message

arch/ia64/kernel/setup.c +0 -2
diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
@@ -317,11 +317,9 @@
 	machvec_init(acpi_get_sysname());
 #endif
 
-#ifdef CONFIG_SMP
 	/* If we register an early console, allow CPU 0 to printk */
 	if (!early_console_setup())
 		cpu_set(smp_processor_id(), cpu_online_map);
-#endif
 
 #ifdef CONFIG_ACPI_BOOT
 	/* Initialize the ACPI boot-time table parser */
arch/ia64/kernel/smpboot.c +0 -41

47 lines not on this page · raw message

arch/ia64/mm/discontig.c +48 -23

122 lines not on this page · raw message

include/asm-ia64/smp.h +1 -0
diff -Nru a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
@@ -126,6 +126,7 @@
 #else
 
 #define cpu_logical_id(cpuid)		0
+#define cpu_physical_id(i)	((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
 
 #endif /* CONFIG_SMP */
 #endif /* _ASM_IA64_SMP_H */
include/asm-ia64/sn/sn_cpuid.h +0 -4
diff -Nru a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
@@ -83,10 +83,6 @@
  *
  */
 
-#ifndef CONFIG_SMP
-#define cpu_physical_id(cpuid)			((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
-#endif
-
 /*
  * macros for some of these exist in sn/addrs.h & sn/arch.h, etc. However, 
  * trying #include these files here causes circular dependencies.
#1 lore raw
Quoted 9 lines · Jesse Barnes

This patch fixes the issues I saw with CONFIG_SMP=n when building a generic kernel with CONFIG_NUMA=y and CONFIG_DISCONTIGMEM=y. It's still pretty rough, but I'd appreciate comments and testing on other platforms. The per-cpu fixes are still pretty ugly--I'm sure I'm missing something that would make abstracting out per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data much nicer looking.

Fixing the build of generic kernels w/o CONFIG_NUMA or CONFIG_DISCONTIGMEM is left as an exercise for the reader. :)

Here's the results of some 2.6.8 boot testing:

-----------------------------------------------------------------------------
generic-no-smp-2 generic_defconfig
patch? delta machine results
-----------------------------------------------------------------------------
No ITANIUM=y HP i2000 OK
-----------------------------------------------------------------------------
Yes ITANIUM=y HP i2000 OK
-----------------------------------------------------------------------------
Yes ITANIUM=y N/A build fails [1]
SMP=n
-----------------------------------------------------------------------------
Yes ITANIUM=y N/A build fails [2]
SMP=n
CYCLONE=n
-----------------------------------------------------------------------------
Yes ITANIUM=y N/A OK
SMP=n
CYCLONE=n HP i2000
SERIAL_SGI_L1_CONSOLE=n
-----------------------------------------------------------------------------
Yes HP rx2600 OK
-----------------------------------------------------------------------------
Yes SMP=n HP rx2600 OK
CYCLONE=n
SERIAL_SGI_L1_CONSOLE=n
[1]
CC arch/ia64/kernel/cyclone.o
arch/ia64/kernel/cyclone.c:13: error: parse error before "cyclone_setup"
arch/ia64/kernel/cyclone.c:14: warning: return type defaults to `int'
arch/ia64/kernel/cyclone.c: In function `get_offset_cyclone':
arch/ia64/kernel/cyclone.c:29: warning: implicit declaration of function `readl'arch/ia64/kernel/cyclone.c: At top level:
arch/ia64/kernel/cyclone.c:78: error: parse error before "init_cyclone_clock"
arch/ia64/kernel/cyclone.c:79: warning: return type defaults to `int'
arch/ia64/kernel/cyclone.c: In function `init_cyclone_clock':
arch/ia64/kernel/cyclone.c:92: warning: implicit declaration of function `ioremap_nocache'
arch/ia64/kernel/cyclone.c:92: warning: cast to pointer from integer of different size
arch/ia64/kernel/cyclone.c:98: warning: implicit declaration of function readq'arch/ia64/kernel/cyclone.c:104: warning: implicit declaration of function iounmap' arch/ia64/kernel/cyclone.c:108: warning: cast to pointer from integer of different size
arch/ia64/kernel/cyclone.c:114: warning: implicit declaration of function `writel'
arch/ia64/kernel/cyclone.c:119: warning: cast to pointer from integer of different size
arch/ia64/kernel/cyclone.c:130: warning: cast to pointer from integer of different size
arch/ia64/kernel/cyclone.c: At top level:
arch/ia64/kernel/cyclone.c:157: warning: type defaults to int' in declaration of __initcall'
arch/ia64/kernel/cyclone.c:157: warning: parameter names (without types) in function declaration
arch/ia64/kernel/cyclone.c:157: warning: data definition has no type or storage class
make[1]: *** [arch/ia64/kernel/cyclone.o] Error 1
make: *** [arch/ia64/kernel] Error 2

[2]
CC drivers/serial/sn_console.o
drivers/serial/sn_console.c: In function `snt_sim_puts':
drivers/serial/sn_console.c:216: warning: implicit declaration of function writeb' drivers/serial/sn_console.c: In function snt_sim_getc':
drivers/serial/sn_console.c:230: warning: implicit declaration of function `readb' drivers/serial/sn_console.c: At top level:
drivers/serial/sn_console.c:1090: error: parse error before "else" make[2]: *** [drivers/serial/sn_console.o] Error 1
make[1]: *** [drivers/serial] Error 2
make: *** [drivers] Error 2

#2 lore raw
In reply to Jesse Barnes

On Sun, 15 Aug 2004 21:29:37 -0600 dann frazier wrote:

| On Fri, Aug 13, 2004 at 03:59:59PM -0700, Jesse Barnes wrote:
| > This patch fixes the issues I saw with CONFIG_SMP=n when building a generic 
| > kernel with CONFIG_NUMA=y and CONFIG_DISCONTIGMEM=y.  It's still pretty 
| > rough, but I'd appreciate comments and testing on other platforms.  The 
| > per-cpu fixes are still pretty ugly--I'm sure I'm missing something that 
| > would make abstracting out per_cpu(cpu_info, cpu).node_data = 
| > mem_data[node].node_data much nicer looking.
| > 
| > Fixing the build of generic kernels w/o CONFIG_NUMA or CONFIG_DISCONTIGMEM is 
| > left as an exercise for the reader. :)
| 
| Here's the results of some 2.6.8 boot testing:
| 
| -----------------------------------------------------------------------------
|  generic-no-smp-2    generic_defconfig                                     
|     patch?                delta               machine           results    
| -----------------------------------------------------------------------------
|      No               ITANIUM=y                HP i2000            OK
| -----------------------------------------------------------------------------
|      Yes              ITANIUM=y                HP i2000            OK
| -----------------------------------------------------------------------------
|      Yes              ITANIUM=y                   N/A         build fails [1]
|                       SMP=n
| -----------------------------------------------------------------------------
|      Yes              ITANIUM=y                   N/A         build fails [2]
|                       SMP=n
|                       CYCLONE=n
| -----------------------------------------------------------------------------
|      Yes              ITANIUM=y                   N/A              OK
|                       SMP=n
|                       CYCLONE=n                HP i2000
|                       SERIAL_SGI_L1_CONSOLE=n
| -----------------------------------------------------------------------------
|      Yes                                       HP rx2600           OK
| -----------------------------------------------------------------------------
|      Yes              SMP=n                    HP rx2600           OK
|                       CYCLONE=n
|                       SERIAL_SGI_L1_CONSOLE=n
| [1]

is fixed by the attached patch...

| [2]

[2] is fixed by
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.8.1/2.6.8.1-mm1/broken-out/fix-sn_console-for-config_smp=n.patch

--
~Randy

fix ia64 cyclone build errors

diffstat:=

 arch/ia64/kernel/cyclone.c |    3 +++
 1 files changed, 3 insertions(+)
arch/ia64/kernel/cyclone.c renamed from arch/ia64/kernel/cyclone.c~ia64_no_smp +3 -0
diff -Naurp ./arch/ia64/kernel/cyclone.c~ia64_no_smp ./arch/ia64/kernel/cyclone.c
@@ -1,7 +1,10 @@
+#include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/time.h>
 #include <linux/errno.h>
 
+#include <asm/io.h>
+
 /* IBM Summit (EXA) Cyclone counter code*/
 #define CYCLONE_CBAR_ADDR 0xFEB00CD0
 #define CYCLONE_PMCC_OFFSET 0x51A0
#3 lore raw
In reply to Jesse Barnes
Quoted 28 lines · dann frazier
Quoted 8 lines · Jesse Barnes

This patch fixes the issues I saw with CONFIG_SMP=n when building a
generic kernel with CONFIG_NUMA=y and CONFIG_DISCONTIGMEM=y. It's still
pretty rough, but I'd appreciate comments and testing on other platforms.
The per-cpu fixes are still pretty ugly--I'm sure I'm missing something
that would make abstracting out per_cpu(cpu_info, cpu).node_data > > mem_data[node].node_data much nicer looking.

Fixing the build of generic kernels w/o CONFIG_NUMA or CONFIG_DISCONTIGMEM is left as an exercise for the reader. :)

Here's the results of some 2.6.8 boot testing:

---------------------------------------------------------------------------
-- generic-no-smp-2 generic_defconfig
patch? delta machine results
---------------------------------------------------------------------------
-- No ITANIUM=y HP i2000 OK
---------------------------------------------------------------------------
-- Yes ITANIUM=y HP i2000 OK
---------------------------------------------------------------------------
-- Yes ITANIUM=y N/A build fails [1]
SMP=n
---------------------------------------------------------------------------
-- Yes ITANIUM=y N/A build fails [2]
SMP=n
CYCLONE=n
---------------------------------------------------------------------------
-- Yes ITANIUM=y N/A OK SMP=n

Quoted 8 lines

CYCLONE=n HP i2000
SERIAL_SGI_L1_CONSOLE=n
---------------------------------------------------------------------------
-- Yes HP rx2600 OK
---------------------------------------------------------------------------
-- Yes SMP=n HP rx2600 OK
CYCLONE=n
SERIAL_SGI_L1_CONSOLE=n

I posted fixes for cyclone and the sgi console driver separately. They should get in soon.

Jesse

#4 lore raw
In reply to Jesse Barnes
Quoted 8 lines · Jesse Barnes

This patch fixes the issues I saw with CONFIG_SMP=n when building a generic
kernel with CONFIG_NUMA=y and CONFIG_DISCONTIGMEM=y. It's still pretty
rough, but I'd appreciate comments and testing on other platforms. The
per-cpu fixes are still pretty ugly--I'm sure I'm missing something that
would make abstracting out per_cpu(cpu_info, cpu).node_data > mem_data[node].node_data much nicer looking.

Fixing the build of generic kernels w/o CONFIG_NUMA or CONFIG_DISCONTIGMEM is left as an exercise for the reader. :)

No comments? Tony, do you think it's ready to apply?

Thanks,
Jesse