summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2017-03-14 20:39:06 +0000
committermjg <mjg@FreeBSD.org>2017-03-14 20:39:06 +0000
commit57f28a25af7dd32fc8adea80c5ebb2b237cc86a6 (patch)
tree737cb08dda40f605ac675a646c2cc84187887b9a /sys/conf
parent8c08bfe0a237cbc568a58adcefa2b61e7a46fa9d (diff)
downloadFreeBSD-src-57f28a25af7dd32fc8adea80c5ebb2b237cc86a6.zip
FreeBSD-src-57f28a25af7dd32fc8adea80c5ebb2b237cc86a6.tar.gz
MFC r312888:
Introduce __read_mostly and __exclusive_cache_line macros. The intended use is to annotate frequently used globals which either rarely change (and thus can be grouped in the same cacheline) or are an atomic counter (which means it may benefit from being the only variable in the cacheline). Linker script support is provided only for amd64. Architectures without it risk having other variables put in, i.e. as if they were not annotated. This is harmless from correctness point of view.
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/ldscript.amd6411
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/conf/ldscript.amd64 b/sys/conf/ldscript.amd64
index a9521d8..80ddba9 100644
--- a/sys/conf/ldscript.amd64
+++ b/sys/conf/ldscript.amd64
@@ -145,6 +145,17 @@ SECTIONS
.got : { *(.got) }
. = DATA_SEGMENT_RELRO_END (24, .);
.got.plt : { *(.got.plt) }
+ . = ALIGN(64);
+ .data.read_mostly :
+ {
+ *(.data.read_mostly)
+ }
+ . = ALIGN(64);
+ .data.exclusive_cache_line :
+ {
+ *(.data.exclusive_cache_line)
+ }
+ . = ALIGN(64);
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
OpenPOWER on IntegriCloud