Sprinkle __read_frequently on few obvious places.

Note that some of annotated variables should probably change their types
to something smaller, preferably bit-sized.
This commit is contained in:
Mateusz Guzik 2017-09-06 20:33:33 +00:00
parent cf558f10a7
commit 574adb65c8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323236
6 changed files with 11 additions and 11 deletions

View File

@ -54,7 +54,7 @@ dtrace_doubletrap_func_t dtrace_doubletrap_func;
dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr;
dtrace_return_probe_ptr_t dtrace_return_probe_ptr;
systrace_probe_func_t systrace_probe_func;
systrace_probe_func_t __read_frequently systrace_probe_func;
/* Return the DTrace process data size compiled in the kernel hooks. */
size_t

View File

@ -62,7 +62,7 @@ SDT_PROBE_DEFINE1(lockstat, , , sx__downgrade, "struct sx *");
SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t");
volatile int __read_mostly lockstat_enabled;
volatile int __read_frequently lockstat_enabled;
uint64_t
lockstat_nsecs(struct lock_object *lo)

View File

@ -140,7 +140,7 @@ struct lock_class lock_class_mtx_spin = {
#ifdef ADAPTIVE_MUTEXES
static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging");
static struct lock_delay_config __read_mostly mtx_delay;
static struct lock_delay_config __read_frequently mtx_delay;
SYSCTL_INT(_debug_mtx, OID_AUTO, delay_base, CTLFLAG_RW, &mtx_delay.base,
0, "");
@ -153,7 +153,7 @@ LOCK_DELAY_SYSINIT_DEFAULT(mtx_delay);
static SYSCTL_NODE(_debug, OID_AUTO, mtx_spin, CTLFLAG_RD, NULL,
"mtx spin debugging");
static struct lock_delay_config __read_mostly mtx_spin_delay;
static struct lock_delay_config __read_frequently mtx_spin_delay;
SYSCTL_INT(_debug_mtx_spin, OID_AUTO, delay_base, CTLFLAG_RW,
&mtx_spin_delay.base, 0, "");

View File

@ -93,14 +93,14 @@ struct lock_class lock_class_rw = {
};
#ifdef ADAPTIVE_RWLOCKS
static int rowner_retries = 10;
static int rowner_loops = 10000;
static int __read_frequently rowner_retries = 10;
static int __read_frequently rowner_loops = 10000;
static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL,
"rwlock debugging");
SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, "");
SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, "");
static struct lock_delay_config __read_mostly rw_delay;
static struct lock_delay_config __read_frequently rw_delay;
SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_base, CTLFLAG_RW, &rw_delay.base,
0, "");

View File

@ -142,13 +142,13 @@ struct lock_class lock_class_sx = {
#endif
#ifdef ADAPTIVE_SX
static u_int asx_retries = 10;
static u_int asx_loops = 10000;
static __read_frequently u_int asx_retries = 10;
static __read_frequently u_int asx_loops = 10000;
static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging");
SYSCTL_UINT(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, "");
SYSCTL_UINT(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, "");
static struct lock_delay_config __read_mostly sx_delay;
static struct lock_delay_config __read_frequently sx_delay;
SYSCTL_INT(_debug_sx, OID_AUTO, delay_base, CTLFLAG_RW, &sx_delay.base,
0, "");

View File

@ -96,7 +96,7 @@ static SYSCTL_NODE(_security, OID_AUTO, audit, CTLFLAG_RW, 0,
*
* Define the audit control flags.
*/
int audit_enabled;
int __read_frequently audit_enabled;
int audit_suspended;
/*