]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] s390: add read_mostly optimization
authorChristian Borntraeger <cborntra@de.ibm.com>
Fri, 28 Apr 2006 01:40:24 +0000 (18:40 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 28 Apr 2006 15:33:48 +0000 (08:33 -0700)
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 <cborntra@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/s390/kernel/vmlinux.lds.S
include/asm-s390/cache.h

index 9289face30278e7270600a6188c522d293bd0dfa..9f34bb54c05129c83327dbd04211ffc83c75b531 100644 (file)
@@ -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 */
index e20cdd9074db398cc5d7440600fa22e3d8cb66ee..cdf431b061bbc5eb57cb1807f11cda8ffc888867 100644 (file)
@@ -16,4 +16,6 @@
 
 #define ARCH_KMALLOC_MINALIGN  8
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif