mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
0db925af1d
commit
6c036527a6
11 changed files with 31 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue