Lines Matching refs:waiter

64  * Bit0 indicates a non-empty waiter list; unlock must issue a wakeup.
65 * Bit1 indicates unlock needs to hand the lock to the top-waiter
195 static inline bool __mutex_waiter_is_first(struct mutex *lock, struct mutex_waiter *waiter)
197 return list_first_entry(&lock->wait_list, struct mutex_waiter, list) == waiter;
201 * Add @waiter to a given location in the lock wait_list and set the
202 * FLAG_WAITERS flag if it's the first waiter.
205 __mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
208 debug_mutex_add_waiter(lock, waiter, current);
210 list_add_tail(&waiter->list, list);
211 if (__mutex_waiter_is_first(lock, waiter))
216 __mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter)
218 list_del(&waiter->list);
222 debug_mutex_remove_waiter(lock, waiter, current);
305 struct mutex_waiter *waiter)
328 * lock from a waiter with an earlier stamp, since the
332 if (!waiter && (atomic_long_read(&lock->owner) & MUTEX_FLAG_WAITERS))
337 * first waiter.
339 if (waiter && !__mutex_waiter_is_first(lock, waiter))
353 struct ww_acquire_ctx *ww_ctx, struct mutex_waiter *waiter)
378 if (ww_ctx && !ww_mutex_spin_on_owner(lock, ww_ctx, waiter)) {
435 * The waiter flag is set to true if the spinner is a waiter in the wait
436 * queue. The waiter-spinner will spin on the lock directly and concurrently
442 struct mutex_waiter *waiter)
444 if (!waiter) {
448 * in case spinning isn't possible. As a waiter-spinner
476 if (!mutex_spin_on_owner(lock, owner, ww_ctx, waiter))
488 if (!waiter)
495 if (!waiter)
518 struct mutex_waiter *waiter)
578 struct mutex_waiter waiter;
633 debug_mutex_lock_common(lock, &waiter);
634 waiter.task = current;
636 waiter.ww_ctx = ww_ctx;
642 __mutex_add_waiter(lock, &waiter, &lock->wait_list);
648 ret = __ww_mutex_add_waiter(&waiter, lock, ww_ctx);
678 ret = __ww_mutex_check_kill(lock, &waiter, ww_ctx);
686 first = __mutex_waiter_is_first(lock, &waiter);
699 if (mutex_optimistic_spin(lock, ww_ctx, &waiter))
716 !__mutex_waiter_is_first(lock, &waiter))
720 __mutex_remove_waiter(lock, &waiter);
722 debug_mutex_free_waiter(&waiter);
738 __mutex_remove_waiter(lock, &waiter);
742 debug_mutex_free_waiter(&waiter);
919 * but instead set it to the top waiter.
941 struct mutex_waiter *waiter =
945 next = waiter->task;
947 debug_mutex_wake_waiter(lock, waiter);