aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2017-01-27 15:03:51 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2017-01-27 15:03:51 +0000
commit290511163d64df58da9dbde07b130a6c4c96d981 (patch)
tree596936626d12aa693826a144e583d06d9ef0c12a /sys/kern
parent17071ff29803ec116b11d64f9ad367577eb45d8e (diff)
downloadsrc-290511163d64df58da9dbde07b130a6c4c96d981.tar.gz
src-290511163d64df58da9dbde07b130a6c4c96d981.zip
Sprinkle __read_mostly on backoff and lock profiling code.
MFC after: 1 month
Notes
Notes: svn path=/head/; revision=312890
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_lockstat.c3
-rw-r--r--sys/kern/kern_mutex.c4
-rw-r--r--sys/kern/kern_rwlock.c2
-rw-r--r--sys/kern/kern_sx.c2
-rw-r--r--sys/kern/subr_lock.c2
5 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_lockstat.c b/sys/kern/kern_lockstat.c
index c5a26a333055..10da98bbb0d6 100644
--- a/sys/kern/kern_lockstat.c
+++ b/sys/kern/kern_lockstat.c
@@ -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)
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 2ca178110efb..35bbd5f78c3f 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -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,
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index a3c502a6c4d9..99df700c8836 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -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,
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index d89df3b5bcc8..64b758314d30 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -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,
diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c
index bfe189d4363e..f83ba58f7aa4 100644
--- a/sys/kern/subr_lock.c
+++ b/sys/kern/subr_lock.c
@@ -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