• Davidlohr Bueso's avatar
    kernel/futex: Kill rt_mutex_next_owner() · 9a4b99fc
    Davidlohr Bueso authored
    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:
    
        c1e2f0ea (futex: Avoid violating the 10th rule of futex)
        9f5d1c33 (futex: Handle transient "ownerless" rtmutex state correctly)
    
    (ii) rt_mutex_next_owner() and rt_mutex_top_waiter() are semantically
    equivalent, as of:
    
        c28d62cf (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: default avatarDavidlohr Bueso <dbueso@suse.de>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20210226175029.50335-1-dave@stgolabs.net
    9a4b99fc
rtmutex_common.h 4.11 KB