Lines Matching refs:waiter

195 static inline bool __mutex_waiter_is_first(struct mutex *lock, struct mutex_waiter *waiter)  in __mutex_waiter_is_first()  argument
197 return list_first_entry(&lock->wait_list, struct mutex_waiter, list) == waiter; in __mutex_waiter_is_first()
205 __mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, in __mutex_add_waiter() argument
208 debug_mutex_add_waiter(lock, waiter, current); in __mutex_add_waiter()
210 list_add_tail(&waiter->list, list); in __mutex_add_waiter()
211 if (__mutex_waiter_is_first(lock, waiter)) in __mutex_add_waiter()
216 __mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter) in __mutex_remove_waiter() argument
218 list_del(&waiter->list); in __mutex_remove_waiter()
222 debug_mutex_remove_waiter(lock, waiter, current); in __mutex_remove_waiter()
305 struct mutex_waiter *waiter) in ww_mutex_spin_on_owner() argument
332 if (!waiter && (atomic_long_read(&lock->owner) & MUTEX_FLAG_WAITERS)) in ww_mutex_spin_on_owner()
339 if (waiter && !__mutex_waiter_is_first(lock, waiter)) in ww_mutex_spin_on_owner()
353 struct ww_acquire_ctx *ww_ctx, struct mutex_waiter *waiter) in mutex_spin_on_owner() argument
378 if (ww_ctx && !ww_mutex_spin_on_owner(lock, ww_ctx, waiter)) { in mutex_spin_on_owner()
442 struct mutex_waiter *waiter) in mutex_optimistic_spin() argument
444 if (!waiter) { in mutex_optimistic_spin()
476 if (!mutex_spin_on_owner(lock, owner, ww_ctx, waiter)) in mutex_optimistic_spin()
488 if (!waiter) in mutex_optimistic_spin()
495 if (!waiter) in mutex_optimistic_spin()
518 struct mutex_waiter *waiter) in mutex_optimistic_spin() argument
578 struct mutex_waiter waiter; in __mutex_lock_common() local
633 debug_mutex_lock_common(lock, &waiter); in __mutex_lock_common()
634 waiter.task = current; in __mutex_lock_common()
636 waiter.ww_ctx = ww_ctx; in __mutex_lock_common()
642 __mutex_add_waiter(lock, &waiter, &lock->wait_list); in __mutex_lock_common()
648 ret = __ww_mutex_add_waiter(&waiter, lock, ww_ctx); in __mutex_lock_common()
678 ret = __ww_mutex_check_kill(lock, &waiter, ww_ctx); in __mutex_lock_common()
686 first = __mutex_waiter_is_first(lock, &waiter); in __mutex_lock_common()
699 if (mutex_optimistic_spin(lock, ww_ctx, &waiter)) in __mutex_lock_common()
716 !__mutex_waiter_is_first(lock, &waiter)) in __mutex_lock_common()
720 __mutex_remove_waiter(lock, &waiter); in __mutex_lock_common()
722 debug_mutex_free_waiter(&waiter); in __mutex_lock_common()
738 __mutex_remove_waiter(lock, &waiter); in __mutex_lock_common()
742 debug_mutex_free_waiter(&waiter); in __mutex_lock_common()
941 struct mutex_waiter *waiter = in __mutex_unlock_slowpath() local
945 next = waiter->task; in __mutex_unlock_slowpath()
947 debug_mutex_wake_waiter(lock, waiter); in __mutex_unlock_slowpath()