| 1226 | } |
| 1227 | |
| 1228 | static void __noinline |
| 1229 | _mtx_lock_indefinite_check(struct mtx *m, struct lock_delay_arg *ldap) |
| 1230 | { |
| 1231 | struct thread *td; |
| 1232 | |
| 1233 | ldap->spin_cnt++; |
| 1234 | if (ldap->spin_cnt < 60000000 || kdb_active || KERNEL_PANICKED()) |
| 1235 | cpu_lock_delay(); |
| 1236 | else { |
| 1237 | td = mtx_owner(m); |
| 1238 | |
| 1239 | /* If the mutex is unlocked, try again. */ |
| 1240 | if (td == NULL) |
| 1241 | return; |
| 1242 | |
| 1243 | printf( "spin lock %p (%s) held by %p (tid %d) too long\n", |
| 1244 | m, m->lock_object.lo_name, td, td->td_tid); |
| 1245 | #ifdef WITNESS |
| 1246 | witness_display_spinlock(&m->lock_object, td, printf); |
| 1247 | #endif |
| 1248 | panic("spin lock held too long"); |
| 1249 | } |
| 1250 | cpu_spinwait(); |
| 1251 | } |
| 1252 | |
| 1253 | void |
| 1254 | mtx_spin_wait_unlocked(struct mtx *m) |
no test coverage detected