MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lock_delay

Function lock_delay

freebsd/kern/subr_lock.c:124–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 &restrict_starvation, 0, "");
123
124void
125lock_delay(struct lock_delay_arg *la)
126{
127 struct lock_delay_config *lc = la->config;
128 u_short i;
129
130 la->delay <<= 1;
131 if (__predict_false(la->delay > lc->max))
132 la->delay = lc->max;
133
134 for (i = la->delay; i > 0; i--)
135 cpu_spinwait();
136
137 la->spin_cnt += la->delay;
138 if (__predict_false(la->spin_cnt > starvation_limit)) {
139 SDT_PROBE1(lock, , , starvation, la->delay);
140 if (restrict_starvation)
141 la->delay = lc->base;
142 }
143}
144
145static u_int
146lock_roundup_2(u_int val)

Callers 12

pmap_delayed_invl_wait_uFunction · 0.85
__rw_rlock_hardFunction · 0.85
kern_rwlock.cFile · 0.85
kern_sx.cFile · 0.85
_sx_slock_hardFunction · 0.85
lockmgr_slock_adaptiveFunction · 0.85
lockmgr_xlock_adaptiveFunction · 0.85
__mtx_lock_sleepFunction · 0.85
_mtx_lock_spin_cookieFunction · 0.85
thread_lock_flags_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected