mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 18:11:20 +00:00
kernel/futex: Kill rt_mutex_next_owner()
Update wake_futex_pi() and kill the call altogether. This is possible because: (i) The case of fixup_owner() in which the pi_mutex was stolen from the signaled enqueued top-waiter which fails to trylock and doesn't see a current owner of the rtmutex but needs to acknowledge an non-enqueued higher priority waiter, which is the other alternative. This used to be handled by rt_mutex_next_owner(), which guaranteed fixup_pi_state_owner('newowner') never to be nil. Nowadays the logic is handled by an EAGAIN loop, without the need of rt_mutex_next_owner(). Specifically:c1e2f0eaf0
(futex: Avoid violating the 10th rule of futex)9f5d1c336a
(futex: Handle transient "ownerless" rtmutex state correctly) (ii) rt_mutex_next_owner() and rt_mutex_top_waiter() are semantically equivalent, as of:c28d62cf52
(locking/rtmutex: Handle non enqueued waiters gracefully in remove_waiter()) So instead of keeping the call around, just use the good ole rt_mutex_top_waiter(). No change in semantics. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20210226175029.50335-1-dave@stgolabs.net
This commit is contained in:
parent
bdb1050ee1
commit
9a4b99fce6
3 changed files with 5 additions and 23 deletions
|
@ -1792,26 +1792,6 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* rt_mutex_next_owner - return the next owner of the lock
|
||||
*
|
||||
* @lock: the rt lock query
|
||||
*
|
||||
* Returns the next owner of the lock or NULL
|
||||
*
|
||||
* Caller has to serialize against other accessors to the lock
|
||||
* itself.
|
||||
*
|
||||
* Special API call for PI-futex support
|
||||
*/
|
||||
struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock)
|
||||
{
|
||||
if (!rt_mutex_has_waiters(lock))
|
||||
return NULL;
|
||||
|
||||
return rt_mutex_top_waiter(lock)->task;
|
||||
}
|
||||
|
||||
/**
|
||||
* rt_mutex_wait_proxy_lock() - Wait for lock acquisition
|
||||
* @lock: the rt_mutex we were woken on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue