Subject: cpu alloc: IA64 support Typical use of per cpu memory for a small system of 8G 8p 4node is less than 64k per cpu memory. This is increasing rapidly for larger systems where we can get up to 512k or 1M of memory used for cpu storage. The maximum size of the cpu area is 128MB of memory. The cpu area is placed in region 5 with the kernel, vmemmap and vmalloc areas. So with this version we are limited to PAGE_SIZEd mappings. The cpu area and the vmemmap area could use a large TLB size. Signed-off-by: Christoph Lameter --- arch/ia64/Kconfig | 19 +++++++++++++++++++ include/asm-ia64/pgtable.h | 27 +++++++++++++++++++++------ 2 files changed, 40 insertions(+), 6 deletions(-) Index: linux-2.6/include/asm-ia64/pgtable.h =================================================================== --- linux-2.6.orig/include/asm-ia64/pgtable.h 2007-11-05 15:14:11.599034489 -0800 +++ linux-2.6/include/asm-ia64/pgtable.h 2007-11-05 15:15:25.243284115 -0800 @@ -224,21 +224,36 @@ ia64_phys_addr_valid (unsigned long addr */ +/* + * Layout of the RGN_GAGE + * + * First part Gate pages and kernel area + * First half VMALLOC Area + * 3rd quarter VMEMMAP Area + * 4th quarter Cpu alloc area + */ + #define VMALLOC_START (RGN_BASE(RGN_GATE) + 0x200000000UL) +#define VMALLOC_END_INIT (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 10))) + #ifdef CONFIG_VIRTUAL_MEM_MAP -# define VMALLOC_END_INIT (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9))) # define VMALLOC_END vmalloc_end extern unsigned long vmalloc_end; #else +# define VMALLOC_END VMALLOC_END_INIT +#endif + #if defined(CONFIG_SPARSEMEM) && defined(CONFIG_SPARSEMEM_VMEMMAP) /* SPARSEMEM_VMEMMAP uses half of vmalloc... */ -# define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 10))) -# define vmemmap ((struct page *)VMALLOC_END) -#else -# define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9))) -#endif +# define vmemmap ((struct page *)VMALLOC_END_INIT) #endif +#define CPU_AREA_BASE (RGN_BASE(RGN_GATE) + (3UL << (4*PAGE_SHIFT - 11))) + +/* + * Cut out the end of pice of the vmalloc area + */ + /* fs/proc/kcore.c */ #define kc_vaddr_to_offset(v) ((v) - RGN_BASE(RGN_GATE)) #define kc_offset_to_vaddr(o) ((o) + RGN_BASE(RGN_GATE)) Index: linux-2.6/arch/ia64/Kconfig =================================================================== --- linux-2.6.orig/arch/ia64/Kconfig 2007-11-05 15:14:11.615034205 -0800 +++ linux-2.6/arch/ia64/Kconfig 2007-11-05 15:15:25.243284115 -0800 @@ -99,6 +99,25 @@ config AUDIT_ARCH bool default y +config CPU_AREA_VIRTUAL + bool + default y + +# Maximum of 128 MB cpu_alloc space per cpu +config CPU_AREA_ORDER + int + default "13" + +# +# Expand the area in PAGE_SIZE steps. We could be using +# huge pages if we would move this into region 5. But with the move +# to 64k we will likely be fine here. 64k is more than enough +# for most configurations. +# +config CPU_AREA_ALLOC_ORDER + int + default "0" + choice prompt "System type" default IA64_GENERIC