Date: Wed, 6 Sep 2017 20:32:49 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323235 - in head/sys: conf sys Message-ID: <201709062032.v86KWngu041817@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Wed Sep 6 20:32:49 2017 New Revision: 323235 URL: https://svnweb.freebsd.org/changeset/base/323235 Log: Introduce __read_frequently While __read_mostly groups variables together, their placement is not specified. In particular 2 frequently used variables can end up in different lines. This annotation is only expected to be used for variables read all the time, e.g. on each syscall entry. MFC after: 1 week Modified: head/sys/conf/ldscript.amd64 head/sys/sys/systm.h Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Wed Sep 6 20:28:18 2017 (r323234) +++ head/sys/conf/ldscript.amd64 Wed Sep 6 20:32:49 2017 (r323235) @@ -146,6 +146,10 @@ SECTIONS . = DATA_SEGMENT_RELRO_END (24, .); .got.plt : { *(.got.plt) } . = ALIGN(64); + .data.read_frequently : + { + *(.data.read_frequently) + } .data.read_mostly : { *(.data.read_mostly) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Sep 6 20:28:18 2017 (r323234) +++ head/sys/sys/systm.h Wed Sep 6 20:32:49 2017 (r323235) @@ -138,6 +138,7 @@ void kassert_panic(const char *fmt, ...) __printflike * Align variables. */ #define __read_mostly __section(".data.read_mostly") +#define __read_frequently __section(".data.read_frequently") #define __exclusive_cache_line __aligned(CACHE_LINE_SIZE) \ __section(".data.exclusive_cache_line") /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709062032.v86KWngu041817>