Sprinkle __read_mostly on backoff and lock profiling code.

MFC after:	1 month
This commit is contained in:
Mateusz Guzik 2017-01-27 15:03:51 +00:00
parent 17071ff298
commit 290511163d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312890
5 changed files with 7 additions and 6 deletions

View File

@ -27,6 +27,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/lockstat.h>
#include <sys/sdt.h>
@ -61,7 +62,7 @@ SDT_PROBE_DEFINE1(lockstat, , , sx__downgrade, "struct sx *");
SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t");
int lockstat_enabled = 0;
int __read_mostly 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 mtx_delay = {
static struct lock_delay_config __read_mostly mtx_delay = {
.initial = 1000,
.step = 500,
.min = 100,
@ -171,7 +171,7 @@ LOCK_DELAY_SYSINIT(mtx_delay_sysinit);
static SYSCTL_NODE(_debug, OID_AUTO, mtx_spin, CTLFLAG_RD, NULL,
"mtx spin debugging");
static struct lock_delay_config mtx_spin_delay = {
static struct lock_delay_config __read_mostly mtx_spin_delay = {
.initial = 1000,
.step = 500,
.min = 100,

View File

@ -100,7 +100,7 @@ static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL,
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 rw_delay = {
static struct lock_delay_config __read_mostly rw_delay = {
.initial = 1000,
.step = 500,
.min = 100,

View File

@ -148,7 +148,7 @@ 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 sx_delay = {
static struct lock_delay_config __read_mostly sx_delay = {
.initial = 1000,
.step = 500,
.min = 100,

View File

@ -213,7 +213,7 @@ struct lock_prof_cpu {
struct lock_prof_cpu *lp_cpu[MAXCPU];
volatile int lock_prof_enable = 0;
volatile int __read_mostly lock_prof_enable;
static volatile int lock_prof_resetting;
#define LPROF_SBUF_SIZE 256