[PATCH] x86_64: Inclusion of ScaleMP vSMP architecture patches - vsmp_align

vSMP specific alignment patch to
1. Define INTERNODE_CACHE_SHIFT for vSMP
2. Use this for alignment of critical structures
3. Use INTERNODE_CACHE_SHIFT for ARCH_MIN_TASKALIGN,
and let the slab align task_struct allocations to the internode cacheline size
4. Introduce and use ARCH_MIN_MMSTRUCT_ALIGN for mm_struct slab allocations.

Signed-off-by: Ravikiran Thirumalai <kiran@scalemp.com>
Signed-off-by: Shai Fultheim <shai@scalemp.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Ravikiran G Thirumalai and committed by Linus Torvalds 5fd63b30 99f7b77d

+23 -1
+12
include/asm-x86_64/cache.h
··· 10 #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 11 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 12 13 #endif
··· 10 #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 11 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 12 13 + #ifdef CONFIG_X86_VSMP 14 + 15 + /* vSMP Internode cacheline shift */ 16 + #define INTERNODE_CACHE_SHIFT (12) 17 + #ifdef CONFIG_SMP 18 + #define __cacheline_aligned_in_smp \ 19 + __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ 20 + __attribute__((__section__(".data.page_aligned"))) 21 + #endif 22 + 23 + #endif 24 + 25 #endif
+6
include/asm-x86_64/processor.h
··· 227 extern struct cpuinfo_x86 boot_cpu_data; 228 DECLARE_PER_CPU(struct tss_struct,init_tss); 229 230 #define ARCH_MIN_TASKALIGN 16 231 232 struct thread_struct { 233 unsigned long rsp0;
··· 227 extern struct cpuinfo_x86 boot_cpu_data; 228 DECLARE_PER_CPU(struct tss_struct,init_tss); 229 230 + #ifdef CONFIG_X86_VSMP 231 + #define ARCH_MIN_TASKALIGN (1 << INTERNODE_CACHE_SHIFT) 232 + #define ARCH_MIN_MMSTRUCT_ALIGN (1 << INTERNODE_CACHE_SHIFT) 233 + #else 234 #define ARCH_MIN_TASKALIGN 16 235 + #define ARCH_MIN_MMSTRUCT_ALIGN 0 236 + #endif 237 238 struct thread_struct { 239 unsigned long rsp0;
+5 -1
kernel/fork.c
··· 1298 return pid; 1299 } 1300 1301 void __init proc_caches_init(void) 1302 { 1303 sighand_cachep = kmem_cache_create("sighand_cache", ··· 1320 sizeof(struct vm_area_struct), 0, 1321 SLAB_PANIC, NULL, NULL); 1322 mm_cachep = kmem_cache_create("mm_struct", 1323 - sizeof(struct mm_struct), 0, 1324 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); 1325 }
··· 1298 return pid; 1299 } 1300 1301 + #ifndef ARCH_MIN_MMSTRUCT_ALIGN 1302 + #define ARCH_MIN_MMSTRUCT_ALIGN 0 1303 + #endif 1304 + 1305 void __init proc_caches_init(void) 1306 { 1307 sighand_cachep = kmem_cache_create("sighand_cache", ··· 1316 sizeof(struct vm_area_struct), 0, 1317 SLAB_PANIC, NULL, NULL); 1318 mm_cachep = kmem_cache_create("mm_struct", 1319 + sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN, 1320 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); 1321 }