From: Christian Borntraeger Add a read_mostly section and define __read_mostly to prevent cache line pollution due to writes for mostly read variables. In addition fix the incorrect alignment of the cache_line_aligned data section. s390 has a cacheline size of 256 bytes. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton --- arch/s390/kernel/vmlinux.lds.S | 4 +++- include/asm-s390/cache.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff -puN arch/s390/kernel/vmlinux.lds.S~s390-add-read_mostly-optimization arch/s390/kernel/vmlinux.lds.S --- 25/arch/s390/kernel/vmlinux.lds.S~s390-add-read_mostly-optimization Mon Apr 24 16:46:11 2006 +++ 25-akpm/arch/s390/kernel/vmlinux.lds.S Mon Apr 24 16:46:11 2006 @@ -58,9 +58,11 @@ SECTIONS . = ALIGN(4096); .data.page_aligned : { *(.data.idt) } - . = ALIGN(32); + . = ALIGN(256); .data.cacheline_aligned : { *(.data.cacheline_aligned) } + . = ALIGN(256); + .data.read_mostly : { *(.data.read_mostly) } _edata = .; /* End of data section */ . = ALIGN(8192); /* init_task */ diff -puN include/asm-s390/cache.h~s390-add-read_mostly-optimization include/asm-s390/cache.h --- 25/include/asm-s390/cache.h~s390-add-read_mostly-optimization Mon Apr 24 16:46:11 2006 +++ 25-akpm/include/asm-s390/cache.h Mon Apr 24 16:46:11 2006 @@ -16,4 +16,6 @@ #define ARCH_KMALLOC_MINALIGN 8 +#define __read_mostly __attribute__((__section__(".data.read_mostly"))) + #endif _