Lines Matching refs:lock_object

91 		WITNESS_SAVE(&Giant.lock_object, Giant);		\
104 WITNESS_RESTORE(&Giant.lock_object, Giant); \
114 static void assert_sx(const struct lock_object *lock, int what);
116 static void db_show_sx(const struct lock_object *lock);
118 static void lock_sx(struct lock_object *lock, uintptr_t how);
120 static int owner_sx(const struct lock_object *lock, struct thread **owner);
122 static uintptr_t unlock_sx(struct lock_object *lock);
175 assert_sx(const struct lock_object *lock, int what) in assert_sx()
182 lock_sx(struct lock_object *lock, uintptr_t how) in lock_sx()
194 unlock_sx(struct lock_object *lock) in unlock_sx()
211 owner_sx(const struct lock_object *lock, struct thread **owner) in owner_sx()
257 lock_init(&sx->lock_object, &lock_class_sx, description, NULL, flags); in sx_init_flags()
269 lock_destroy(&sx->lock_object); in sx_destroy()
292 LOCK_LOG_TRY("SLOCK", &sx->lock_object, 0, 1, file, line); in sx_try_slock_int()
293 WITNESS_LOCK(&sx->lock_object, LOP_TRYLOCK, file, line); in sx_try_slock_int()
302 LOCK_LOG_TRY("SLOCK", &sx->lock_object, 0, 0, file, line); in sx_try_slock_int()
325 WITNESS_CHECKORDER(&sx->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, file, in _sx_xlock()
335 LOCK_LOG_LOCK("XLOCK", &sx->lock_object, 0, sx->sx_recurse, in _sx_xlock()
337 WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); in _sx_xlock()
371 if (x == tid && (sx->lock_object.lo_flags & LO_RECURSABLE)) { in sx_try_xlock_int()
380 LOCK_LOG_TRY("XLOCK", &sx->lock_object, 0, rval, file, line); in sx_try_xlock_int()
382 WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, in sx_try_xlock_int()
407 WITNESS_UNLOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); in _sx_xunlock()
408 LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, in _sx_xunlock()
454 LOCK_LOG_TRY("XUPGRADE", &sx->lock_object, 0, success, file, line); in sx_try_upgrade_int()
457 WITNESS_UPGRADE(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, in sx_try_upgrade_int()
490 WITNESS_DOWNGRADE(&sx->lock_object, 0, file, line); in sx_downgrade_int()
513 sleepq_lock(&sx->lock_object); in sx_downgrade_int()
523 sleepq_broadcast(&sx->lock_object, SLEEPQ_SX, 0, in sx_downgrade_int()
525 sleepq_release(&sx->lock_object); in sx_downgrade_int()
529 LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); in sx_downgrade_int()
603 all_time -= lockstat_nsecs(&sx->lock_object); in _sx_xlock_hard()
620 KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0, in _sx_xlock_hard()
625 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xlock_hard()
630 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xlock_hard()
632 sx->lock_object.lo_name, (void *)sx->sx_lock, file, line); in _sx_xlock_hard()
643 lock_profile_obtain_lock_failed(&sx->lock_object, false, &contested, in _sx_xlock_hard()
650 THREAD_CONTENDS_ON_LOCK(&sx->lock_object); in _sx_xlock_hard()
682 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xlock_hard()
687 sx->lock_object.lo_name); in _sx_xlock_hard()
717 sx->lock_object.lo_name); in _sx_xlock_hard()
740 sleepq_lock(&sx->lock_object); in _sx_xlock_hard()
749 sleepq_release(&sx->lock_object); in _sx_xlock_hard()
765 sleepq_release(&sx->lock_object); in _sx_xlock_hard()
771 sleepq_release(&sx->lock_object); in _sx_xlock_hard()
792 sleepq_release(&sx->lock_object); in _sx_xlock_hard()
828 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xlock_hard()
841 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xlock_hard()
846 sleep_time -= lockstat_nsecs(&sx->lock_object); in _sx_xlock_hard()
848 sleepq_add(&sx->lock_object, NULL, sx->lock_object.lo_name, in _sx_xlock_hard()
856 THREAD_CONTENTION_DONE(&sx->lock_object); in _sx_xlock_hard()
858 sleepq_wait(&sx->lock_object, 0); in _sx_xlock_hard()
860 error = sleepq_wait_sig(&sx->lock_object, 0); in _sx_xlock_hard()
861 THREAD_CONTENDS_ON_LOCK(&sx->lock_object); in _sx_xlock_hard()
863 sleep_time += lockstat_nsecs(&sx->lock_object); in _sx_xlock_hard()
867 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xlock_hard()
873 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xlock_hard()
878 THREAD_CONTENTION_DONE(&sx->lock_object); in _sx_xlock_hard()
891 all_time += lockstat_nsecs(&sx->lock_object); in _sx_xlock_hard()
934 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xunlock_hard()
944 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xunlock_hard()
947 sleepq_lock(&sx->lock_object); in _sx_xunlock_hard()
963 sleepq_sleepcnt(&sx->lock_object, SQ_EXCLUSIVE_QUEUE) != 0) { in _sx_xunlock_hard()
970 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_xunlock_hard()
975 sleepq_broadcast(&sx->lock_object, SLEEPQ_SX, 0, queue); in _sx_xunlock_hard()
976 sleepq_release(&sx->lock_object); in _sx_xunlock_hard()
1005 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in __sx_slock_try()
1048 all_time -= lockstat_nsecs(&sx->lock_object); in _sx_slock_hard()
1068 lock_profile_obtain_lock_failed(&sx->lock_object, false, &contested, in _sx_slock_hard()
1075 THREAD_CONTENDS_ON_LOCK(&sx->lock_object); in _sx_slock_hard()
1100 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_slock_hard()
1106 "lockname:\"%s\"", sx->lock_object.lo_name); in _sx_slock_hard()
1126 sx->lock_object.lo_name); in _sx_slock_hard()
1154 sleepq_lock(&sx->lock_object); in _sx_slock_hard()
1159 sleepq_release(&sx->lock_object); in _sx_slock_hard()
1172 sleepq_release(&sx->lock_object); in _sx_slock_hard()
1188 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_slock_hard()
1197 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_slock_hard()
1202 sleep_time -= lockstat_nsecs(&sx->lock_object); in _sx_slock_hard()
1204 sleepq_add(&sx->lock_object, NULL, sx->lock_object.lo_name, in _sx_slock_hard()
1212 THREAD_CONTENTION_DONE(&sx->lock_object); in _sx_slock_hard()
1214 sleepq_wait(&sx->lock_object, 0); in _sx_slock_hard()
1216 error = sleepq_wait_sig(&sx->lock_object, 0); in _sx_slock_hard()
1217 THREAD_CONTENDS_ON_LOCK(&sx->lock_object); in _sx_slock_hard()
1219 sleep_time += lockstat_nsecs(&sx->lock_object); in _sx_slock_hard()
1223 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_slock_hard()
1229 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_slock_hard()
1234 THREAD_CONTENTION_DONE(&sx->lock_object); in _sx_slock_hard()
1240 all_time += lockstat_nsecs(&sx->lock_object); in _sx_slock_hard()
1272 WITNESS_CHECKORDER(&sx->lock_object, LOP_NEWORDER, file, line, NULL); in _sx_slock_int()
1281 lock_profile_obtain_lock_success(&sx->lock_object, false, 0, 0, in _sx_slock_int()
1284 LOCK_LOG_LOCK("SLOCK", &sx->lock_object, 0, 0, file, line); in _sx_slock_int()
1285 WITNESS_LOCK(&sx->lock_object, 0, file, line); in _sx_slock_int()
1306 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_sunlock_try()
1333 sleepq_lock(&sx->lock_object); in _sx_sunlock_hard()
1354 if (LOCK_LOG_TEST(&sx->lock_object, 0)) in _sx_sunlock_hard()
1357 sleepq_broadcast(&sx->lock_object, SLEEPQ_SX, 0, queue); in _sx_sunlock_hard()
1361 sleepq_release(&sx->lock_object); in _sx_sunlock_hard()
1375 WITNESS_UNLOCK(&sx->lock_object, 0, file, line); in _sx_sunlock_int()
1376 LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line); in _sx_sunlock_int()
1384 lock_profile_release_lock(&sx->lock_object, false); in _sx_sunlock_int()
1427 witness_assert(&sx->lock_object, what, file, line); in _sx_assert()
1438 sx->lock_object.lo_name, slocked ? "share " : "", in _sx_assert()
1445 sx->lock_object.lo_name, file, in _sx_assert()
1449 sx->lock_object.lo_name, file, line); in _sx_assert()
1458 sx->lock_object.lo_name, file, line); in _sx_assert()
1462 sx->lock_object.lo_name, file, line); in _sx_assert()
1465 sx->lock_object.lo_name, file, line); in _sx_assert()
1469 witness_assert(&sx->lock_object, what, file, line); in _sx_assert()
1478 sx->lock_object.lo_name, file, line); in _sx_assert()
1490 db_show_sx(const struct lock_object *lock) in db_show_sx()
1546 if (LOCK_CLASS(&sx->lock_object) != &lock_class_sx || in sx_chain()
1547 sx->lock_object.lo_name != td->td_wmesg) in sx_chain()