general config option cleanup
PATCH 1/1 general config option cleanup
As threatened, here's a patch that unifies the ia64 memory init and memmap codepaths by unconditionalizing the CONFIG_VIRTUAL_MEM_MAP code and making CONFIG_DISCONTIGMEM required. It also allows building with CONFIG_SMP=n and/or CONFIG_NUMA=n. The end result should be easier to understand and hack on, and should make things like memory hotplug that much easier since people will only have to worry about one code path instead of every combination of the three options.
Boot tested on sn2 with:CONFIG_IA64_SGI_SN=yCONFIG_NUMA=yCONFIG_SMP=yCONFIG_PREEMPT=y
andCONFIG_IA64_GENERIC=yCONFIG_NUMA=nCONFIG_SMP=nCONFIG_PREEMPT=n
Anyone have a problem with this? Is it a reasonable thing to do? Assuming everyone is ok with it, there's a bit more I could do to make things easier to understand and hack on (and hopefully harder to break), like moving more stuff into numa.c and consolidating a header file or two.
arch/ia64/mm/contig.c | 300 ------------------------------------ b/arch/ia64/Kconfig | 24 --- b/arch/ia64/kernel/Makefile | 1 b/arch/ia64/kernel/acpi.c | 24 ++- b/arch/ia64/kernel/ia64_ksyms.c | 2 b/arch/ia64/kernel/numa.c | 57 +++++++ b/arch/ia64/kernel/setup.c | 2 b/arch/ia64/kernel/smpboot.c | 41 ----- b/arch/ia64/mm/Makefile | 3 b/arch/ia64/mm/discontig.c | 93 ++++++++---- b/arch/ia64/mm/fault.c | 5 b/arch/ia64/mm/init.c | 5 b/arch/ia64/mm/numa.c | 7 b/arch/ia64/sn/kernel/setup.c | 1 b/drivers/acpi/Kconfig | 1 b/include/asm-ia64/acpi.h | 1 b/include/asm-ia64/meminit.h | 18 -- b/include/asm-ia64/mmzone.h | 5 b/include/asm-ia64/nodedata.h | 4 b/include/asm-ia64/numa.h | 9 - b/include/asm-ia64/page.h | 16 -- b/include/asm-ia64/pgtable.h | 18 -- b/include/asm-ia64/processor.h | 4 b/include/asm-ia64/smp.h | 1 b/include/asm-ia64/sn/sn_cpuid.h | 4 b/include/linux/acpi.h | 4 26 files changed, 165 insertions(+), 485 deletions(-)
Thanks,
Jesse
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/09/08 14:39:16-07:00 [email protected]
# config cleanup
#
# arch/ia64/kernel/numa.c # 2004/09/08 14:39:06-07:00 [email protected] +57 -0 # # include/linux/acpi.h # 2004/09/08 14:39:06-07:00 [email protected] +4 -0 # config cleanup # # include/asm-ia64/sn/sn_cpuid.h # 2004/09/08 14:39:06-07:00 [email protected] +0 -4 # config cleanup # # include/asm-ia64/smp.h # 2004/09/08 14:39:06-07:00 [email protected] +1 -0 # config cleanup # # include/asm-ia64/processor.h # 2004/09/08 14:39:06-07:00 [email protected] +1 -3 # config cleanup # # include/asm-ia64/pgtable.h # 2004/09/08 14:39:06-07:00 [email protected] +6 -12 # config cleanup # # include/asm-ia64/page.h # 2004/09/08 14:39:06-07:00 [email protected] +0 -16 # config cleanup # # include/asm-ia64/numa.h # 2004/09/08 14:39:06-07:00 [email protected] +1 -8 # config cleanup # # include/asm-ia64/nodedata.h # 2004/09/08 14:39:06-07:00 [email protected] +0 -4 # config cleanup # # include/asm-ia64/mmzone.h # 2004/09/08 14:39:06-07:00 [email protected] +0 -5 # config cleanup # # include/asm-ia64/meminit.h # 2004/09/08 14:39:06-07:00 [email protected] +6 -12 # config cleanup # # include/asm-ia64/acpi.h # 2004/09/08 14:39:06-07:00 [email protected] +1 -0 # config cleanup # # drivers/acpi/Kconfig # 2004/09/08 14:39:06-07:00 [email protected] +0 -1 # config cleanup # # arch/ia64/sn/kernel/setup.c # 2004/09/08 14:39:06-07:00 [email protected] +1 -0 # config cleanup # # arch/ia64/mm/numa.c # 2004/09/08 14:39:06-07:00 [email protected] +0 -7 # config cleanup # # arch/ia64/mm/init.c # 2004/09/08 14:39:06-07:00 [email protected] +0 -5 # config cleanup # # arch/ia64/mm/fault.c # 2004/09/08 14:39:06-07:00 [email protected] +1 -4 # config cleanup # # arch/ia64/kernel/numa.c # 2004/09/08 14:39:06-07:00 [email protected] +0 -0 # BitKeeper file /home/jbarnes/working/linux-2.5-numa2/arch/ia64/kernel/numa.c # # arch/ia64/mm/discontig.c # 2004/09/08 14:39:05-07:00 [email protected] +62 -31 # config cleanup # # arch/ia64/mm/Makefile # 2004/09/08 14:39:05-07:00 [email protected] +0 -3 # config cleanup # # arch/ia64/kernel/smpboot.c # 2004/09/08 14:39:05-07:00 [email protected] +0 -41 # config cleanup # # arch/ia64/kernel/setup.c # 2004/09/08 14:39:05-07:00 [email protected] +0 -2 # config cleanup # # arch/ia64/kernel/ia64_ksyms.c # 2004/09/08 14:39:05-07:00 [email protected] +0 -2 # config cleanup # # arch/ia64/kernel/acpi.c # 2004/09/08 14:39:05-07:00 [email protected] +21 -3 # config cleanup # # arch/ia64/kernel/Makefile # 2004/09/08 14:39:05-07:00 [email protected] +1 -0 # config cleanup # # arch/ia64/Kconfig # 2004/09/08 14:39:05-07:00 [email protected] +2 -22 # config cleanup # # BitKeeper/deleted/.del-contig.c~11b5d4e44ee69f76 # 2004/09/08 14:20:21-07:00 [email protected] +0 -0 # Delete: arch/ia64/mm/contig.c # diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig 2004-09-08 14:39:48 -07:00 +++ b/arch/ia64/Kconfig 2004-09-08 14:39:48 -07:00 @@ -44,10 +44,6 @@
config IA64_GENERIC
bool "generic"
- select NUMA
- select ACPI_NUMA
- select VIRTUAL_MEM_MAP
- select DISCONTIGMEM
help
This selects the system type of your hardware. A "generic" kernel will run on any supported IA-64 system. However, if you configure
@@ -158,25 +154,9 @@
Access). This option is for configuring high-end multiprocessor server systems. If in doubt, say N.
-config VIRTUAL_MEM_MAP
- bool "Virtual mem map"
- default y if !IA64_HP_SIM
- help
- Say Y to compile the kernel with support for a virtual mem map. - This code also only takes effect if a memory hole of greater than - 1 Gb is found during boot. You must turn this option on if you - require the DISCONTIGMEM option for your machine. If you are - unsure, say Y.
-
config DISCONTIGMEM
- bool "Discontiguous memory support"
- depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1) && NUMA && VIRTUAL_MEM_MAP
- default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA
- help
- Say Y to support efficient handling of discontiguous physical memory, - for architectures which are either NUMA (Non-Uniform Memory Access) - or have huge holes in the physical address space for other reasons. - See <file:Documentation/vm/numa> for more.
+ bool
+ default y
config IA64_CYCLONE
bool "Cyclone (EXA) Time Source support"
arch/ia64/kernel/Makefile +1 -0
@@ -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 +21 -3
@@ -359,6 +359,17 @@/* maps to convert between proximity domain and logical node ID */ int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS ];int __initdata nid_to_pxm_map[MAX_NUMNODES ]; + +/* +* The following structures are usually initialized by ACPI or +* similar mechanisms and describe the NUMA characteristics of the machine. +*/ +int num_node_memblks; +struct node_memblk_s node_memblk[NR_NODE_MEMBLKS ]; +struct node_cpuid_s node_cpuid[NR_CPUS ]; + +#ifdef CONFIG_NUMA +static struct acpi_table_slit __initdata *slit_table;/*
@@ -380,6 +391,7 @@ } slit_table = slit; } +#endif void __init acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa)
@@ -434,7 +446,10 @@void __init acpi_numa_arch_fixup (void ) { -int i, j, node_from, node_to; +int i, j; +#ifdef CONFIG_NUMA +int node_from, node_to; +#endif /* If there's no SRAT, fix the phys_id */ if (srat_num_cpus ==0 ) {
@@ -475,7 +490,7 @@printk (KERN_INFO "Number of logical nodes in system = %d\n" , numnodes);printk (KERN_INFO "Number of memory chunks in system = %d\n" , num_node_memblks); - +#ifdef CONFIG_NUMA if (!slit_table)return ;memset (numa_slit,-1 ,sizeof (numa_slit));for (i=0 ; i<slit_table->localities; i++) {
@@ -490,6 +505,7 @@ slit_table->entry[i*slit_table->localities + j]; } } +#endif #ifdef SLIT_DEBUG printk ("ACPI 2.0 SLIT locality table:\n" );
@@ -624,8 +640,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_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/ia64_ksyms.c +0 -2
@@ -40,10 +40,8 @@#include <asm/page.h> EXPORT_SYMBOL (clear_page); -#ifdef CONFIG_VIRTUAL_MEM_MAP #include <linux/bootmem.h> EXPORT_SYMBOL (max_low_pfn);/* defined by bootmem.c, but not exported by generic code */ -#endif #include <asm/processor.h> EXPORT_SYMBOL (per_cpu__cpu_info);
arch/ia64/kernel/numa.c new file +57 -0
57 lines not on this page · raw message
arch/ia64/kernel/setup.c +0 -2
@@ -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/Makefile +0 -3
@@ -7,6 +7,3 @@ obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_DISCONTIGMEM) += discontig.o -ifndef CONFIG_DISCONTIGMEM -obj-y += contig.o -endif
arch/ia64/mm/contig.c deleted +0 -300
300 lines not on this page · raw message
arch/ia64/mm/discontig.c +62 -31
194 lines not on this page · raw message
arch/ia64/mm/fault.c +1 -4
@@ -85,7 +85,6 @@if (in_atomic () || !mm) goto no_context; -#ifdef CONFIG_VIRTUAL_MEM_MAP /* * If fault is in region 5 and we are in the kernel, we may already * have the mmap_sem (pfn_valid macro is called during mmap). There
@@ -95,7 +94,6 @@if ((REGION_NUMBER (address) ==5 ) && !user_mode (regs)) goto bad_area_no_up; -#endif down_read (&mm->mmap_sem);
@@ -178,9 +176,8 @@ bad_area:up_read (&mm->mmap_sem); -#ifdef CONFIG_VIRTUAL_MEM_MAP + bad_area_no_up: -#endif if ((isr &IA64_ISR_SP ) || ((isr &IA64_ISR_NA ) && (isr &IA64_ISR_CODE_MASK ) ==IA64_ISR_CODE_LFETCH )) {
arch/ia64/mm/init.c +0 -5
@@ -43,12 +43,10 @@unsigned long MAX_DMA_ADDRESS =PAGE_OFFSET +0x100000000UL ; -#ifdef CONFIG_VIRTUAL_MEM_MAP unsigned long vmalloc_end =VMALLOC_END_INIT ;EXPORT_SYMBOL (vmalloc_end);struct page *vmem_map;EXPORT_SYMBOL (vmem_map); -#endif static int pgt_cache_water[2 ] = {25 ,50 };
@@ -360,8 +358,6 @@ ia64_mca_tlb_list[cpu].ptce_stride[1 ] = local_cpu_data->ptce_stride[1 ]; } -#ifdef CONFIG_VIRTUAL_MEM_MAP -int create_mem_map_page_table (u64 start,u64 end,void *arg) {
@@ -480,7 +476,6 @@ last_end = end;return 0 ; } -#endif /* CONFIG_VIRTUAL_MEM_MAP */ static int count_reserved_pages (u64 start,u64 end,void *arg)
arch/ia64/mm/numa.c +0 -7
@@ -24,13 +24,6 @@static struct cpu *sysfs_cpus;/* -* The following structures are usually initialized by ACPI or -* similar mechanisms and describe the NUMA characteristics of the machine. -*/ -int num_node_memblks; -struct node_memblk_s node_memblk[NR_NODE_MEMBLKS ]; -struct node_cpuid_s node_cpuid[NR_CPUS ]; -/* * This is a matrix with "distances" between nodes, they should be * proportional to the memory access latency ratios. */
arch/ia64/sn/kernel/setup.c +1 -0
@@ -29,6 +29,7 @@#include <linux/sched.h> #include <linux/root_dev.h> +#include <asm/acpi.h> #include <asm/io.h> #include <asm/sal.h> #include <asm/machvec.h>
drivers/acpi/Kconfig +0 -1
@@ -142,7 +142,6 @@ config ACPI_NUMA bool "NUMA support" depends on ACPI_INTERPRETER - depends on NUMA depends on IA64 default y if IA64_GENERIC || IA64_SGI_SN2
include/asm-ia64/acpi.h +1 -0
@@ -30,6 +30,7 @@#ifdef __KERNEL__ +#include <linux/config.h> #include <linux/init.h> #include <linux/numa.h> #include <asm/system.h>
include/asm-ia64/meminit.h +6 -12
@@ -41,20 +41,14 @@#define GRANULEROUNDUP (n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))#define ORDERROUNDDOWN (n) ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1)) -#ifdef CONFIG_DISCONTIGMEM -extern void call_pernode_memory (unsigned long start,unsigned long len,void *func); -#else -# define call_pernode_memory (start, len, func) (*func)(start, len, 0) -#endif +extern void call_pernode_memory (unsigned long start,unsigned long len,void *func);#define IGNORE_PFN0 1/* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */ -#ifdef CONFIG_VIRTUAL_MEM_MAP -# define LARGE_GAP 0x40000000/* Use virtual mem map if hole is > than this */ -extern unsigned long vmalloc_end; -extern struct page *vmem_map; -extern int find_largest_hole (u64 start,u64 end,void *arg); -extern int create_mem_map_page_table (u64 start,u64 end,void *arg); -#endif +#define LARGE_GAP 0x40000000/* Use virtual mem map if hole is > than this */ +extern unsigned long vmalloc_end; +extern struct page *vmem_map; +extern int find_largest_hole (u64 start,u64 end,void *arg); +extern int create_mem_map_page_table (u64 start,u64 end,void *arg);#endif /* meminit_h */
include/asm-ia64/mmzone.h +0 -5
@@ -15,8 +15,6 @@#include <asm/page.h> #include <asm/meminit.h> -#ifdef CONFIG_DISCONTIGMEM -#ifdef CONFIG_IA64_DIG /* DIG systems are small */ # define MAX_PHYSNODE_ID 8# define NR_NODES 8
@@ -33,7 +31,4 @@#define page_to_pfn (page) ((unsigned long) (page - vmem_map))#define pfn_to_page (pfn) (vmem_map + (pfn)) -#else /* CONFIG_DISCONTIGMEM */ -# define NR_NODE_MEMBLKS 4 -#endif /* CONFIG_DISCONTIGMEM */ #endif /* _ASM_IA64_MMZONE_H */
include/asm-ia64/nodedata.h +0 -4
@@ -17,8 +17,6 @@#include <asm/percpu.h> #include <asm/mmzone.h> -#ifdef CONFIG_DISCONTIGMEM -/* * Node Data. One of these structures is located on each node of a NUMA system. */
@@ -46,7 +44,5 @@* completes. */ #define NODE_DATA (nid) (local_node_data->pg_data_ptrs[nid]) - -#endif /* CONFIG_DISCONTIGMEM */ #endif /* _ASM_IA64_NODEDATA_H */
include/asm-ia64/numa.h +1 -8
@@ -12,9 +12,6 @@#define _ASM_IA64_NUMA_H#include <linux/config.h> - -#ifdef CONFIG_NUMA -#include <linux/cache.h> #include <linux/cpumask.h> #include <linux/numa.h>
@@ -58,17 +55,13 @@* proportional to the memory access latency ratios. */ +#ifdef CONFIG_NUMA extern u8 numa_slit[MAX_NUMNODES *MAX_NUMNODES ];#define node_distance (from,to) (numa_slit[(from) * numnodes + (to)]) -extern int paddr_to_nid (unsigned long paddr); -#define local_nodeid (cpu_to_node_map[smp_processor_id()]) -#else /* !CONFIG_NUMA */ -#define paddr_to_nid (addr) 0 -#endif /* CONFIG_NUMA */ #endif /* _ASM_IA64_NUMA_H */
include/asm-ia64/page.h +0 -16
@@ -77,23 +77,7 @@#define virt_addr_valid (kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) -#ifdef CONFIG_VIRTUAL_MEM_MAP extern int ia64_pfn_valid (unsigned long pfn); -#else -# define ia64_pfn_valid (pfn) 1 -#endif - -#ifndef CONFIG_DISCONTIGMEM -# ifdef CONFIG_VIRTUAL_MEM_MAP -extern struct page *vmem_map; -# define pfn_valid (pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) -# define page_to_pfn (page) ((unsigned long) (page - vmem_map)) -# define pfn_to_page (pfn) (vmem_map + (pfn)) -# endif -#define pfn_valid (pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) -#define page_to_pfn (page) ((unsigned long) (page - mem_map)) -#define pfn_to_page (pfn) (mem_map + (pfn)) -#endif /* CONFIG_DISCONTIGMEM */ #define page_to_phys (page) (page_to_pfn(page) << PAGE_SHIFT)#define virt_to_page (kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
include/asm-ia64/pgtable.h +6 -12
@@ -207,13 +207,9 @@#define RGN_KERNEL 7#define VMALLOC_START 0xa000000200000000 -#ifdef CONFIG_VIRTUAL_MEM_MAP -# define VMALLOC_END_INIT (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) -# define VMALLOC_END vmalloc_end -extern unsigned long vmalloc_end; -#else -# define VMALLOC_END (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) -#endif +#define VMALLOC_END_INIT (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) +#define VMALLOC_END vmalloc_end +extern unsigned long vmalloc_end;/* fs/proc/kcore.c */ #define kc_vaddr_to_offset (v) ((v) - 0xa000000000000000)
@@ -517,12 +513,10 @@ ptep_establish(__vma, __addr, __ptep, __entry)#endif -# ifdef CONFIG_VIRTUAL_MEM_MAP /* arch mem_map init routine is needed due to holes in a virtual mem_map */ -# define __HAVE_ARCH_MEMMAP_INIT -extern void memmap_init (unsigned long size,int nid,unsigned long zone, -unsigned long start_pfn); -# endif /* CONFIG_VIRTUAL_MEM_MAP */ +#define __HAVE_ARCH_MEMMAP_INIT +extern void memmap_init (unsigned long size,int nid,unsigned long zone, +unsigned long start_pfn);# endif /* !__ASSEMBLY__ */ /*
include/asm-ia64/processor.h +1 -3
@@ -88,9 +88,7 @@#include <asm/rse.h> #include <asm/unwind.h> #include <asm/atomic.h> -#ifdef CONFIG_NUMA #include <asm/nodedata.h> -#endif /* like above but expressed as bitfields for more efficient access: */ struct ia64_psr {
@@ -168,7 +166,7 @@__u8 archrev;char vendor[16 ]; -#ifdef CONFIG_NUMA +#ifdef CONFIG_DISCONTIGMEM struct ia64_node_data *node_data;#endif };
include/asm-ia64/smp.h +1 -0
@@ -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
@@ -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.
include/linux/acpi.h +4 -0
@@ -391,7 +391,11 @@void acpi_table_print_srat_entry (acpi_table_entry_header *srat);/* the following four functions are architecture-dependent */ +#ifdef CONFIG_NUMA void acpi_numa_slit_init (struct acpi_table_slit *slit); +#else +static inline void acpi_numa_slit_init (struct acpi_table_slit *slit) { } +#endif void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa);void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma);void acpi_numa_arch_fixup (void );
Quoted 7 lines · Jesse Barnes
As threatened, here's a patch that unifies the ia64 memory init and memmap codepaths by unconditionalizing the
CONFIG_VIRTUAL_MEM_MAPcode and makingCONFIG_DISCONTIGMEMrequired. It also allows building withCONFIG_SMP=nand/orCONFIG_NUMA=n. The end result should be easier to understand and hack on, and should make things like memory hotplug that much easier since people will only have to worry about one code path instead of every combination of the three options.
I don't really like this. It penalises platforms like Intel's Tiger box that have contiguous memory. I'd really like to see VIRTUAL_MEM_MAP go away and the DISCONTIGMEM code be usable for both zx1/sx1000 and sn2.
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain
Quoted 9 lines · Matthew Wilcox
Quoted 7 lines · Jesse Barnes
As threatened, here's a patch that unifies the ia64 memory init and memmap codepaths by unconditionalizing the
CONFIG_VIRTUAL_MEM_MAPcode and makingCONFIG_DISCONTIGMEMrequired. It also allows building withCONFIG_SMP=nand/orCONFIG_NUMA=n. The end result should be easier to understand and hack on, and should make things like memory hotplug that much easier since people will only have to worry about one code path instead of every combination of the three options.
Quoted 3 lines
I don't really like this. It penalises platforms like Intel's Tiger box that have contiguous memory. I'd really like to see
VIRTUAL_MEM_MAPgo away and the DISCONTIGMEM code be usable for both zx1/sx1000 and sn2.
Have you tried to measure the penalty for discontigmem? I have, and without writing a kernel module that counts the number of alloc_pages calls one could do in a tight loop, I don't think it's measurable. virtual memmap is a little more expensive (i.e. it shows up on benchmarks as something slightly more than noise), but isn't the simplification worth it? We've had CONFIG_DISCONTIGMEM=y/n and/or CONFIG_VIRTUAL_MEM_MAP=y/n breakages several times now...
Jesse
Quoted 4 lines
I don't really like this. It penalises platforms like Intel's Tiger box that have contiguous memory. I'd really like to see
VIRTUAL_MEM_MAPgo away and the DISCONTIGMEM code be usable for both zx1/sx1000 and sn2.
Caveat: I haven't read all of Jesse's patch yet.
CONFIG_VIRTUAL_MEM_MAP isn't entirely accurately named. It *used* to enable the virtual mem_map, but quite a while ago the code was changed so that even if VIRTUAL_MEM_MAP was set, you would only actually use a virtual mem_map if you had big holes in your physical address space. See the:
if (max_gap < LARGE_GAP)
in arch/ia64/mm/contig.c
Also ... Tiger systems only have contiguous physical memory if they have <= 2GB. There is a hole in the physical address space from 2G to 4G to make space for memory mapped I/O devices.
-Tony
Quoted 4 lines · Jesse Barnes
As threatened, here's a patch that unifies the ia64 memory init and memmap codepaths by unconditionalizing the
CONFIG_VIRTUAL_MEM_MAPcode and makingCONFIG_DISCONTIGMEMrequired. It also allows building withCONFIG_SMP=nand/orCONFIG_NUMA=n.
Two related things I noticed. Firstly, shouldn't the ACPI_NUMA option be linked to NUMA (i.e. if you select one, Kconfig selects the other)?
Secondly, trying to build with CONFIG_NUMA and CONFIG_ACPI_NUMA off gave errors like
arch/ia64/mm/built-in.o(.init.text+0x3c0): In function `early_nr_cpus_node':
: undefined reference to node_cpuid' arch/ia64/mm/built-in.o(.init.text+0xf71): In function call_pernode_memory':
: undefined reference to `num_node_memblks'
How about moving the definions in question either outside of #ifdef CONFIG_ACPI_NUMA in apci.c or adding them to discontig.c (as below).
Thanks,
-i
Make it so that builds without NUMA/ACPI_NUMA (ontop of original patch) ===== arch/ia64/kernel/acpi.c 1.75 vs edited =====
arch/ia64/kernel/acpi.c 2004-09-09 10:53:06 +10:00 renamed from arch/ia64/kernel/acpi.c 2004-09-09 10:49:07 +10:00 +0 -8
@@ -360,14 +360,6 @@ int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS]; int __initdata nid_to_pxm_map[MAX_NUMNODES]; -/* - * The following structures are usually initialized by ACPI or - * similar mechanisms and describe the NUMA characteristics of the machine. - */ -int num_node_memblks; -struct node_memblk_s node_memblk[NR_NODE_MEMBLKS]; -struct node_cpuid_s node_cpuid[NR_CPUS]; - #ifdef CONFIG_NUMA static struct acpi_table_slit __initdata *slit_table;
===== arch/ia64/mm/discontig.c 1.19 vs edited =====
arch/ia64/mm/discontig.c 2004-09-09 10:53:43 +10:00 renamed from arch/ia64/mm/discontig.c 2004-09-09 10:49:07 +10:00 +8 -0
@@ -40,6 +40,14 @@ static struct early_node_data mem_data[NR_NODES] __initdata; +/* + * The following structures are usually initialized by ACPI or + * similar mechanisms and describe the NUMA characteristics of the machine. + */ +int num_node_memblks; +struct node_memblk_s node_memblk[NR_NODE_MEMBLKS]; +struct node_cpuid_s node_cpuid[NR_CPUS]; + #ifdef CONFIG_NUMA /** * reassign_cpu_only_nodes - called from find_memory to move CPU-only nodes to a memory node
Quoted 9 lines · Ian Wienand
Quoted 4 lines · Jesse Barnes
As threatened, here's a patch that unifies the ia64 memory init and memmap codepaths by unconditionalizing the
CONFIG_VIRTUAL_MEM_MAPcode and makingCONFIG_DISCONTIGMEMrequired. It also allows building withCONFIG_SMP=nand/orCONFIG_NUMA=n.Two related things I noticed. Firstly, shouldn't the
ACPI_NUMAoption be linked to NUMA (i.e. if you select one,Kconfigselects the other)?
Quoted 7 lines
Secondly, trying to build with
CONFIG_NUMAandCONFIG_ACPI_NUMAoff gave errors likearch/ia64/mm/built-in.o(.init.text+0x3c0): In function `early_nr_cpus_node':
: undefined reference to `node_cpuid'arch/ia64/mm/built-in.o(.init.text+0xf71): In function
`call_pernode_memory':
Quoted 4 lines
: undefined reference to `num_node_memblks'
How about moving the definions in question either outside of #ifdef
CONFIG_ACPI_NUMAinapci.cor adding them todiscontig.c(as below).
Hmm... yeah, I knew that would break. The thing is, ia64 NUMA machines all provide ACPI NUMA tables to describe their NUMAness, so I figured it was pointless to try and break that up, but I don't really mind either way.
Jesse