All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -v4 00/10] FUTEX_UNLOCK_PI wobbles
@ 2016-12-13  8:36 Peter Zijlstra
  2016-12-13  8:36 ` [PATCH -v4 01/10] futex: Fix potential use-after-free in FUTEX_REQUEUE_PI Peter Zijlstra
                   ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Peter Zijlstra @ 2016-12-13  8:36 UTC (permalink / raw)
  To: tglx
  Cc: mingo, juri.lelli, rostedt, xlpang, bigeasy, linux-kernel,
	mathieu.desnoyers, jdesfossez, bristot, dvhart, peterz


Hi all,

This is (I think) the 4th attempt at fixing this tiny pesky issue with
FUTEX_UNLOCK_PI, where we would really like to drop (and unboost) the rt_mutex
without holding hb->lock.

While going through the requeue PI code and thinking about how all that worked
I realized we can avoid the entire problem I've been trying to solve. That is,
the 'problem' is that futex state and rt_mutex state can end up disagreeing on
who is waiting for the lock and we muddle around that with intricate state.

This series, well patch 8, avoids the entire problem by making sure this
inconsistent state does not occur. Which then simplifies everything -- assuming
I got it right of course :-)

The basic idea is to, like requeue PI, break the rt_mutex_lock() function into
pieces, such that we can enqueue the waiter while holding hb->lock, wait for
acquisition without hb->lock and can remove the waiter, on failure, while
holding hb->lock again.

That way, when we drop hb->lock to wait, futex and rt_mutex wait state is
consistent.


In any case, it passes our inadequate testing.

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-03-17  0:35 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-13  8:36 [PATCH -v4 00/10] FUTEX_UNLOCK_PI wobbles Peter Zijlstra
2016-12-13  8:36 ` [PATCH -v4 01/10] futex: Fix potential use-after-free in FUTEX_REQUEUE_PI Peter Zijlstra
2016-12-16 23:58   ` Darren Hart
2016-12-13  8:36 ` [PATCH -v4 02/10] futex: Add missing error handling to FUTEX_REQUEUE_PI Peter Zijlstra
2016-12-17  0:06   ` Darren Hart
2016-12-17 13:54     ` Peter Zijlstra
2016-12-18 23:31       ` Darren Hart
2016-12-13  8:36 ` [PATCH -v4 03/10] futex: Cleanup variable names for futex_top_waiter() Peter Zijlstra
2016-12-17  0:13   ` Darren Hart
2017-02-22 14:07     ` Peter Zijlstra
2016-12-13  8:36 ` [PATCH -v4 04/10] futex: Use smp_store_release() in mark_wake_futex() Peter Zijlstra
2016-12-17  0:50   ` Darren Hart
2017-02-22 14:03     ` Peter Zijlstra
2017-03-17  0:35       ` Darren Hart
2016-12-13  8:36 ` [PATCH -v4 05/10] futex: Remove rt_mutex_deadlock_account_*() Peter Zijlstra
2016-12-13  8:36 ` [PATCH -v4 06/10] futex,rt_mutex: Provide futex specific rt_mutex API Peter Zijlstra
2016-12-13  8:36 ` [PATCH -v4 07/10] futex: Change locking Peter Zijlstra
2016-12-13  8:36 ` [PATCH -v4 08/10] futex: Rework futex_lock_pi() vs rt_mutex_timed_futex_lock() Peter Zijlstra
2016-12-13  8:36 ` [PATCH -v4 09/10] futex: Remove inconsistent hb/rt_mutex state magic Peter Zijlstra
2016-12-13  8:36 ` [PATCH -v4 10/10] futex: Pull rt_mutex_futex_unlock() out from under hb->lock Peter Zijlstra
2016-12-13 16:07 ` [PATCH -v4 00/10] FUTEX_UNLOCK_PI wobbles Peter Zijlstra
2017-02-22 11:02   ` Peter Zijlstra
2017-02-22 15:36     ` Peter Zijlstra
2017-03-01  9:05       ` Thomas Gleixner
2017-03-03  9:35         ` Peter Zijlstra
2016-12-16 23:31 ` Darren Hart
2016-12-17 13:52   ` Peter Zijlstra
2016-12-18 22:39     ` Darren Hart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.