• Peter Zijlstra's avatar
    futex: Fix (possible) missed wakeup · b061c38b
    Peter Zijlstra authored
    We must not rely on wake_q_add() to delay the wakeup; in particular
    commit:
    
      1d0dcb3a ("futex: Implement lockless wakeups")
    
    moved wake_q_add() before smp_store_release(&q->lock_ptr, NULL), which
    could result in futex_wait() waking before observing ->lock_ptr ==
    NULL and going back to sleep again.
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Fixes: 1d0dcb3a ("futex: Implement lockless wakeups")
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    b061c38b
futex.c 104 KB