locks: convert delay times to u_short
int is just a waste of space for this purpose.
This commit is contained in:
parent
d6ae918835
commit
6b8dd26e7c
@ -144,9 +144,9 @@ static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging");
|
||||
|
||||
static struct lock_delay_config __read_frequently mtx_delay;
|
||||
|
||||
SYSCTL_INT(_debug_mtx, OID_AUTO, delay_base, CTLFLAG_RW, &mtx_delay.base,
|
||||
SYSCTL_U16(_debug_mtx, OID_AUTO, delay_base, CTLFLAG_RW, &mtx_delay.base,
|
||||
0, "");
|
||||
SYSCTL_INT(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW, &mtx_delay.max,
|
||||
SYSCTL_U16(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW, &mtx_delay.max,
|
||||
0, "");
|
||||
|
||||
LOCK_DELAY_SYSINIT_DEFAULT(mtx_delay);
|
||||
|
@ -94,18 +94,18 @@ struct lock_class lock_class_rw = {
|
||||
};
|
||||
|
||||
#ifdef ADAPTIVE_RWLOCKS
|
||||
static int __read_frequently rowner_retries;
|
||||
static int __read_frequently rowner_loops;
|
||||
static u_short __read_frequently rowner_retries;
|
||||
static u_short __read_frequently rowner_loops;
|
||||
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, "");
|
||||
SYSCTL_U16(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, "");
|
||||
SYSCTL_U16(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, "");
|
||||
|
||||
static struct lock_delay_config __read_frequently rw_delay;
|
||||
|
||||
SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_base, CTLFLAG_RW, &rw_delay.base,
|
||||
SYSCTL_U16(_debug_rwlock, OID_AUTO, delay_base, CTLFLAG_RW, &rw_delay.base,
|
||||
0, "");
|
||||
SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_max, CTLFLAG_RW, &rw_delay.max,
|
||||
SYSCTL_U16(_debug_rwlock, OID_AUTO, delay_max, CTLFLAG_RW, &rw_delay.max,
|
||||
0, "");
|
||||
|
||||
static void
|
||||
|
@ -143,17 +143,17 @@ struct lock_class lock_class_sx = {
|
||||
#endif
|
||||
|
||||
#ifdef ADAPTIVE_SX
|
||||
static __read_frequently u_int asx_retries;
|
||||
static __read_frequently u_int asx_loops;
|
||||
static u_short __read_frequently asx_retries;
|
||||
static u_short __read_frequently asx_loops;
|
||||
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, "");
|
||||
SYSCTL_U16(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, "");
|
||||
SYSCTL_U16(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, "");
|
||||
|
||||
static struct lock_delay_config __read_frequently sx_delay;
|
||||
|
||||
SYSCTL_INT(_debug_sx, OID_AUTO, delay_base, CTLFLAG_RW, &sx_delay.base,
|
||||
SYSCTL_U16(_debug_sx, OID_AUTO, delay_base, CTLFLAG_RW, &sx_delay.base,
|
||||
0, "");
|
||||
SYSCTL_INT(_debug_sx, OID_AUTO, delay_max, CTLFLAG_RW, &sx_delay.max,
|
||||
SYSCTL_U16(_debug_sx, OID_AUTO, delay_max, CTLFLAG_RW, &sx_delay.max,
|
||||
0, "");
|
||||
|
||||
static void
|
||||
|
@ -123,7 +123,7 @@ void
|
||||
lock_delay(struct lock_delay_arg *la)
|
||||
{
|
||||
struct lock_delay_config *lc = la->config;
|
||||
u_int i;
|
||||
u_short i;
|
||||
|
||||
la->delay <<= 1;
|
||||
if (__predict_false(la->delay > lc->max))
|
||||
|
@ -183,13 +183,13 @@ extern struct lock_class lock_class_lockmgr;
|
||||
extern struct lock_class *lock_classes[];
|
||||
|
||||
struct lock_delay_config {
|
||||
u_int base;
|
||||
u_int max;
|
||||
u_short base;
|
||||
u_short max;
|
||||
};
|
||||
|
||||
struct lock_delay_arg {
|
||||
struct lock_delay_config *config;
|
||||
u_int delay;
|
||||
u_short delay;
|
||||
u_int spin_cnt;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user