Skip to content

Commit

Permalink
[PATCH] s390: add read_mostly optimization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Borntraeger authored and Linus Torvalds committed Apr 28, 2006
1 parent b73d40c commit 58268b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/s390/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions include/asm-s390/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@

#define ARCH_KMALLOC_MINALIGN 8

#define __read_mostly __attribute__((__section__(".data.read_mostly")))

#endif

0 comments on commit 58268b9

Please sign in to comment.