Lines Matching refs:owner
48 atomic_long_set(&lock->owner, 0); in __mutex_init()
81 return (struct task_struct *)(atomic_long_read(&lock->owner) & ~MUTEX_FLAGS); in __mutex_owner()
84 static inline struct task_struct *__owner_task(unsigned long owner) in __owner_task() argument
86 return (struct task_struct *)(owner & ~MUTEX_FLAGS); in __owner_task()
95 static inline unsigned long __owner_flags(unsigned long owner) in __owner_flags() argument
97 return owner & MUTEX_FLAGS; in __owner_flags()
105 unsigned long owner, curr = (unsigned long)current; in __mutex_trylock_common() local
107 owner = atomic_long_read(&lock->owner); in __mutex_trylock_common()
109 unsigned long flags = __owner_flags(owner); in __mutex_trylock_common()
110 unsigned long task = owner & ~MUTEX_FLAGS; in __mutex_trylock_common()
129 if (atomic_long_try_cmpxchg_acquire(&lock->owner, &owner, task | flags)) { in __mutex_trylock_common()
136 return __owner_task(owner); in __mutex_trylock_common()
171 if (atomic_long_try_cmpxchg_acquire(&lock->owner, &zero, curr)) in __mutex_trylock_fast()
181 return atomic_long_try_cmpxchg_release(&lock->owner, &curr, 0UL); in __mutex_unlock_fast()
187 atomic_long_or(flag, &lock->owner); in __mutex_set_flag()
192 atomic_long_andnot(flag, &lock->owner); in __mutex_clear_flag()
233 unsigned long owner = atomic_long_read(&lock->owner); in __mutex_handoff() local
238 MUTEX_WARN_ON(__owner_task(owner) != current); in __mutex_handoff()
239 MUTEX_WARN_ON(owner & MUTEX_FLAG_PICKUP); in __mutex_handoff()
241 new = (owner & MUTEX_FLAG_WAITERS); in __mutex_handoff()
246 if (atomic_long_try_cmpxchg_release(&lock->owner, &owner, new)) in __mutex_handoff()
332 if (!waiter && (atomic_long_read(&lock->owner) & MUTEX_FLAG_WAITERS)) in ww_mutex_spin_on_owner()
352 bool mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner, in mutex_spin_on_owner() argument
359 while (__mutex_owner(lock) == owner) { in mutex_spin_on_owner()
373 if (!owner_on_cpu(owner) || need_resched()) { in mutex_spin_on_owner()
394 struct task_struct *owner; in mutex_can_spin_on_owner() local
407 owner = __mutex_owner(lock); in mutex_can_spin_on_owner()
408 if (owner) in mutex_can_spin_on_owner()
409 retval = owner_on_cpu(owner); in mutex_can_spin_on_owner()
465 struct task_struct *owner; in mutex_optimistic_spin() local
468 owner = __mutex_trylock_or_owner(lock); in mutex_optimistic_spin()
469 if (!owner) in mutex_optimistic_spin()
476 if (!mutex_spin_on_owner(lock, owner, ww_ctx, waiter)) in mutex_optimistic_spin()
905 unsigned long owner; in __mutex_unlock_slowpath() local
916 owner = atomic_long_read(&lock->owner); in __mutex_unlock_slowpath()
918 MUTEX_WARN_ON(__owner_task(owner) != current); in __mutex_unlock_slowpath()
919 MUTEX_WARN_ON(owner & MUTEX_FLAG_PICKUP); in __mutex_unlock_slowpath()
921 if (owner & MUTEX_FLAG_HANDOFF) in __mutex_unlock_slowpath()
924 if (atomic_long_try_cmpxchg_release(&lock->owner, &owner, __owner_flags(owner))) { in __mutex_unlock_slowpath()
925 if (owner & MUTEX_FLAG_WAITERS) in __mutex_unlock_slowpath()
946 if (owner & MUTEX_FLAG_HANDOFF) in __mutex_unlock_slowpath()