FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_mprof.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/lock_profile.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/pcpu.h>
#include <sys/proc.h>
#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <machine/cpufunc.h>
Go to the source code of this file.
Functions | |
__FBSDID ("$FreeBSD$") | |
SDT_PROVIDER_DEFINE (lock) | |
SDT_PROBE_DEFINE1 (lock,,, starvation, "u_int") | |
CTASSERT (LOCK_CLASS_MAX==15) | |
void | lock_init (struct lock_object *lock, struct lock_class *class, const char *name, const char *type, int flags) |
void | lock_destroy (struct lock_object *lock) |
static | SYSCTL_NODE (_debug, OID_AUTO, lock, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, "lock debugging") |
static | SYSCTL_NODE (_debug_lock, OID_AUTO, delay, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, "lock delay") |
SYSCTL_INT (_debug_lock_delay, OID_AUTO, starvation_limit, CTLFLAG_RW, &starvation_limit, 0, "") | |
SYSCTL_INT (_debug_lock_delay, OID_AUTO, restrict_starvation, CTLFLAG_RW, &restrict_starvation, 0, "") | |
void | lock_delay (struct lock_delay_arg *la) |
static u_int | lock_roundup_2 (u_int val) |
void | lock_delay_default_init (struct lock_delay_config *lc) |
SYSCTL_U16 (_debug_lock, OID_AUTO, delay_base, CTLFLAG_RW, &locks_delay.base, 0, "") | |
SYSCTL_U16 (_debug_lock, OID_AUTO, delay_max, CTLFLAG_RW, &locks_delay.max, 0, "") | |
SYSCTL_U16 (_debug_lock, OID_AUTO, delay_retries, CTLFLAG_RW, &locks_delay_retries, 0, "") | |
SYSCTL_U16 (_debug_lock, OID_AUTO, delay_loops, CTLFLAG_RW, &locks_delay_loops, 0, "") | |
static void | locks_delay_init (void *arg __unused) |
LOCK_DELAY_SYSINIT (locks_delay_init) | |
Variables | |
struct lock_class * | lock_classes [LOCK_CLASS_MAX+1] |
static u_int __read_mostly | starvation_limit = 131072 |
static u_int __read_mostly | restrict_starvation = 0 |
struct lock_delay_config __read_frequently | locks_delay |
u_short __read_frequently | locks_delay_retries |
u_short __read_frequently | locks_delay_loops |
__FBSDID | ( | "$FreeBSD$" | ) |
CTASSERT | ( | LOCK_CLASS_MAX | = =15 | ) |
void lock_delay | ( | struct lock_delay_arg * | la | ) |
Definition at line 132 of file subr_lock.c.
References lc, restrict_starvation, and starvation_limit.
Referenced by __mtx_lock_sleep(), __rw_rlock_hard(), __rw_wlock_hard(), _sx_slock_hard(), _sx_xlock_hard(), lockmgr_slock_adaptive(), lockmgr_xlock_adaptive(), and thread_lock_flags_().
void lock_delay_default_init | ( | struct lock_delay_config * | lc | ) |
Definition at line 164 of file subr_lock.c.
References lc, lock_roundup_2(), and mp_ncpus.
Referenced by locks_delay_init().
LOCK_DELAY_SYSINIT | ( | locks_delay_init | ) |
void lock_destroy | ( | struct lock_object * | lock | ) |
Definition at line 108 of file subr_lock.c.
Referenced by _mtx_destroy(), _rw_destroy(), lockdestroy(), rm_destroy(), and sx_destroy().
void lock_init | ( | struct lock_object * | lock, |
struct lock_class * | class, | ||
const char * | name, | ||
const char * | type, | ||
int | flags | ||
) |
Definition at line 83 of file subr_lock.c.
References flags, lock_classes, name, and type.
Referenced by _mtx_init(), _rw_init_flags(), lockinit(), rm_init_flags(), and sx_init_flags().
|
static |
Definition at line 153 of file subr_lock.c.
References res.
Referenced by lock_delay_default_init().
|
static |
Definition at line 187 of file subr_lock.c.
References lock_delay_default_init(), locks_delay, locks_delay_loops, and locks_delay_retries.
SDT_PROBE_DEFINE1 | ( | lock | , |
starvation | , | ||
"u_int" | |||
) |
SDT_PROVIDER_DEFINE | ( | lock | ) |
SYSCTL_INT | ( | _debug_lock_delay | , |
OID_AUTO | , | ||
restrict_starvation | , | ||
CTLFLAG_RW | , | ||
& | restrict_starvation, | ||
0 | , | ||
"" | |||
) |
SYSCTL_INT | ( | _debug_lock_delay | , |
OID_AUTO | , | ||
starvation_limit | , | ||
CTLFLAG_RW | , | ||
& | starvation_limit, | ||
0 | , | ||
"" | |||
) |
|
static |
|
static |
SYSCTL_U16 | ( | _debug_lock | , |
OID_AUTO | , | ||
delay_base | , | ||
CTLFLAG_RW | , | ||
&locks_delay. | base, | ||
0 | , | ||
"" | |||
) |
SYSCTL_U16 | ( | _debug_lock | , |
OID_AUTO | , | ||
delay_loops | , | ||
CTLFLAG_RW | , | ||
& | locks_delay_loops, | ||
0 | , | ||
"" | |||
) |
SYSCTL_U16 | ( | _debug_lock | , |
OID_AUTO | , | ||
delay_max | , | ||
CTLFLAG_RW | , | ||
&locks_delay. | max, | ||
0 | , | ||
"" | |||
) |
SYSCTL_U16 | ( | _debug_lock | , |
OID_AUTO | , | ||
delay_retries | , | ||
CTLFLAG_RW | , | ||
& | locks_delay_retries, | ||
0 | , | ||
"" | |||
) |
struct lock_class* lock_classes[LOCK_CLASS_MAX+1] |
struct lock_delay_config __read_frequently locks_delay |
Definition at line 173 of file subr_lock.c.
Referenced by locks_delay_init().
u_short __read_frequently locks_delay_loops |
Definition at line 175 of file subr_lock.c.
Referenced by locks_delay_init().
u_short __read_frequently locks_delay_retries |
Definition at line 174 of file subr_lock.c.
Referenced by locks_delay_init().
|
static |
Definition at line 127 of file subr_lock.c.
Referenced by lock_delay().
|
static |
Definition at line 123 of file subr_lock.c.
Referenced by lock_delay().