mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
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
This commit is contained in:
parent
fe933c1d88
commit
cf558f10a7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323235
|
@ -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)
|
||||
|
|
|
@ -138,6 +138,7 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2);
|
|||
* 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")
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue