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")
 /*
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to