FUTEX_UNLOCK_PI wobbles
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 17 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | futex: Fix potential use-after-free in FUTEX_REQUEUE_PIkernel/ | +11 | 1 reply | |
| 2/10 | futex: Add missing error handling to FUTEX_REQUEUE_PIkernel/ | +2 | 3 replies | |
| 3/10 | futex: Cleanup variable names for futex_top_waiter()kernel/ | +15 | 2 replies | |
| 4/10 | futex: Use smp_store_release() in mark_wake_futex()kernel/ | +1 | 3 replies | |
| 5/10 | futex: Remove rt_mutex_deadlock_account_*()kernel/ kernel/ kernel/ +1 more | +18 | 0 replies | |
| 6/10 | futex,rt_mutex: Provide futex specific rt_mutex APIkernel/ kernel/ kernel/ | +62 | 0 replies | |
| 7/10 | futex: Change lockingkernel/ | +123 | 0 replies | |
| 8/10 | futex: Rework futex_lock_pi() vs rt_mutex_timed_futex_lock()kernel/ kernel/ kernel/ | +88 | 0 replies | |
| 9/10 | futex: Remove inconsistent hb/rt_mutex state magickernel/ | +1 | 0 replies | |
| 10/10 | futex: Pull rt_mutex_futex_unlock() out from under hb->lockkernel/ | +92 | 0 replies |
Reviews trailers per patch
2 of 10 patches have a Reviewed-by or Acked-by.
| Patch | Darren Hart |
|---|---|
| 1/10 | R-b |
| 2/10 | R-b |
| 3/10 | |
| 4/10 | |
| 5/10 | |
| 6/10 | |
| 7/10 | |
| 8/10 | |
| 9/10 | |
| 10/10 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH -v4 00/10] FUTEX_UNLOCK_PI wobbles
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.