Lines Matching defs:owner
48 atomic_long_set(&lock->owner, 0);
57 static inline struct task_struct *__owner_task(unsigned long owner)
59 return (struct task_struct *)(owner & ~MUTEX_FLAGS);
68 static inline unsigned long __owner_flags(unsigned long owner)
70 return owner & MUTEX_FLAGS;
76 unsigned long owner = atomic_long_read(&lock->owner);
78 return (unsigned long)__owner_task(owner);
86 unsigned long owner, curr = (unsigned long)current;
88 owner = atomic_long_read(&lock->owner);
90 unsigned long flags = __owner_flags(owner);
91 unsigned long task = owner & ~MUTEX_FLAGS;
110 if (atomic_long_try_cmpxchg_acquire(&lock->owner, &owner, task | flags)) {
117 return __owner_task(owner);
159 if (atomic_long_try_cmpxchg_acquire(&lock->owner, &zero, curr))
169 return atomic_long_try_cmpxchg_release(&lock->owner, &curr, 0UL);
189 atomic_long_or(flag, &lock->owner);
194 atomic_long_andnot(flag, &lock->owner);
237 unsigned long owner = atomic_long_read(&lock->owner);
242 MUTEX_WARN_ON(__owner_task(owner) != current);
243 MUTEX_WARN_ON(owner & MUTEX_FLAG_PICKUP);
245 new = (owner & MUTEX_FLAG_WAITERS);
250 if (atomic_long_try_cmpxchg_release(&lock->owner, &owner, new))
336 if (!waiter && (atomic_long_read(&lock->owner) & MUTEX_FLAG_WAITERS))
350 * Look out! "owner" is an entirely speculative pointer access and not
356 bool mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner,
363 while (__mutex_owner(lock) == owner) {
365 * Ensure we emit the owner->on_cpu, dereference _after_
366 * checking lock->owner still matches owner. And we already
377 if (!owner_on_cpu(owner) || need_resched()) {
398 struct task_struct *owner;
411 owner = __mutex_owner(lock);
412 if (owner)
413 retval = owner_on_cpu(owner);
416 * If lock->owner is not set, the mutex has been released. Return true
426 * We try to spin for acquisition when we find that the lock owner
428 * need to reschedule. The rationale is that if the lock owner is
441 * with the spinner at the head of the OSQ, if present, until the owner is
462 * MCS (queued) lock first before spinning on the owner field.
469 struct task_struct *owner;
472 owner = __mutex_trylock_or_owner(lock);
473 if (!owner)
477 * There's an owner, wait for it to either
480 if (!mutex_spin_on_owner(lock, owner, ww_ctx, waiter))
602 * race and wound us here since they can't have a valid owner
808 * race and wound us here, since they can't have a valid owner
935 unsigned long owner;
944 * Except when HANDOFF, in that case we must not clear the owner field,
947 owner = atomic_long_read(&lock->owner);
949 MUTEX_WARN_ON(__owner_task(owner) != current);
950 MUTEX_WARN_ON(owner & MUTEX_FLAG_PICKUP);
952 if (owner & MUTEX_FLAG_HANDOFF)
955 if (atomic_long_try_cmpxchg_release(&lock->owner, &owner, __owner_flags(owner))) {
956 if (owner & MUTEX_FLAG_WAITERS)
978 if (owner & MUTEX_FLAG_HANDOFF)