Skip to contentSkip to conversation

fix Summit srat.h includes

PATCH In review Dave Hansen 2 participants 2 messages Sep 7, 2003 – Sep 8, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix Summit srat.h includes

I was compiling for my plain 'ol PC, and was getting unresolved symbols for get_memcfg_from_srat() and get_zholes_size(). The CONFIG_NUMA definition right now allows it to be turned on for plain old X86_PC. Does anyone know why this is?

depends on SMP && HIGHMEM64G &&

          (X86_PC || X86_NUMAQ || X86_GENERICARCH || 
                  (X86_SUMMIT && ACPI && !ACPI_HT_ONLY))

In any case, the summit code incorrectly assumes in at least 2 places that NUMA && !NUMAQ means summit. Someone was evidently trying to cover the generic subarch case, but that's already taken care of by the lovely config system and CONFIG_ACPI_SRAT. This patch fixes those assumptions and adds a nice little warning for people that try to #include srat.h without having srat support turned on.

Signature · 2 lines
Dave Hansen
[email protected]
include/asm-i386/mmzone.h +1 -1
diff -ru linux-2.6.0-test4/include/asm-i386/mmzone.h linux-2.6.0-test4-srat/include/asm-i386/mmzone.h
@@ -119,7 +119,7 @@
 
 #ifdef CONFIG_X86_NUMAQ
 #include <asm/numaq.h>
-#elif CONFIG_NUMA	/* summit or generic arch */
+#elif CONFIG_ACPI_SRAT
 #include <asm/srat.h>
 #elif CONFIG_X86_PC
 #define get_memcfg_numa get_memcfg_numa_flat
include/asm-i386/numnodes.h +1 -1
diff -ru linux-2.6.0-test4/include/asm-i386/numnodes.h linux-2.6.0-test4-srat/include/asm-i386/numnodes.h
@@ -5,7 +5,7 @@
 
 #ifdef CONFIG_X86_NUMAQ
 #include <asm/numaq.h>
-#elif CONFIG_NUMA
+#elif CONFIG_ACPI_SRAT
 #include <asm/srat.h>
 #else
 #define MAX_NUMNODES	1
include/asm-i386/srat.h +4 -0
diff -ru linux-2.6.0-test4/include/asm-i386/srat.h linux-2.6.0-test4-srat/include/asm-i386/srat.h
@@ -27,6 +27,10 @@
 #ifndef _ASM_SRAT_H_
 #define _ASM_SRAT_H_
 
+#ifndef CONFIG_ACPI_SRAT
+#error CONFIG_ACPI_SRAT not defined, and srat.h header has been included
+#endif
+
 #define MAX_NUMNODES		8
 extern void get_memcfg_from_srat(void);
 extern unsigned long *get_zholes_size(int);
#1 lore raw
Quoted 4 lines

I was compiling for my plain 'ol PC, and was getting unresolved symbols for get_memcfg_from_srat() and get_zholes_size(). The CONFIG_NUMA definition right now allows it to be turned on for plain old X86_PC. Does anyone know why this is?

Yeah, distros want it, so they can ship one kernel for SMP that covers NUMA and non-NUMA, switching dynamically.

Quoted 10 lines

depends on SMP && HIGHMEM64G &&

          (X86_PC || X86_NUMAQ || X86_GENERICARCH || 
                  (X86_SUMMIT && ACPI && !ACPI_HT_ONLY))

In any case, the summit code incorrectly assumes in at least 2 places that NUMA && !NUMAQ means summit. Someone was evidently trying to cover the generic subarch case, but that's already taken care of by the lovely config system and CONFIG_ACPI_SRAT. This patch fixes those assumptions and adds a nice little warning for people that try to #include srat.h without having srat support turned on.

Nice, thanks. Yeah, the generic NUMA on generic PC code will need a bit of tidy up, but it should more or less work ;-)

Thanks,

M.