summaryrefslogtreecommitdiff
path: root/include/linux/cache.h
diff options
context:
space:
mode:
authorChristoph Lameter <christoph@lameter.com>2005-07-07 17:56:59 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 18:23:46 -0700
commit6c036527a630720063b67d9a65455e8caca2c8fa (patch)
tree316e947f5f4efcda0205e48044ed1d12665eaed1 /include/linux/cache.h
parent0db925af1db5f3dfe1691c35b39496e2baaff9c9 (diff)
downloadlinux-3.10-6c036527a630720063b67d9a65455e8caca2c8fa.tar.gz
linux-3.10-6c036527a630720063b67d9a65455e8caca2c8fa.tar.bz2
linux-3.10-6c036527a630720063b67d9a65455e8caca2c8fa.zip
[PATCH] mostly_read data section
Add a new section called ".data.read_mostly" for data items that are read frequently and rarely written to like cpumaps etc. If these maps are placed in the .data section then these frequenly read items may end up in cachelines with data is is frequently updated. In that case all processors in an SMP system must needlessly reload the cachelines again and again containing elements of those frequently used variables. The ability to share these cachelines will allow each cpu in an SMP system to keep local copies of those shared cachelines thereby optimizing performance. Signed-off-by: Alok N Kataria <alokk@calsoftinc.com> Signed-off-by: Shobhit Dayal <shobhit@calsoftinc.com> Signed-off-by: Christoph Lameter <christoph@scalex86.org> Signed-off-by: Shai Fultheim <shai@scalex86.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/cache.h')
-rw-r--r--include/linux/cache.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 4d767b93738..2b66a36d85f 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,6 +13,12 @@
#define SMP_CACHE_BYTES L1_CACHE_BYTES
#endif
+#ifdef CONFIG_X86
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#else
+#define __read_mostly
+#endif
+
#ifndef ____cacheline_aligned
#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
#endif