| 122 | &restrict_starvation, 0, ""); |
| 123 | |
| 124 | void |
| 125 | lock_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 | |
| 145 | static u_int |
| 146 | lock_roundup_2(u_int val) |
no outgoing calls
no test coverage detected