Re: [patch V5 11/16] futex: Provide infrastructure to plug the non contended robust futex unlock race
From: Peter Zijlstra
Date: Wed Jun 03 2026 - 05:03:36 EST
On Tue, Jun 02, 2026 at 11:10:04AM +0200, Thomas Gleixner wrote:
> When the FUTEX_ROBUST_UNLOCK mechanism is used for unlocking (PI-)futexes,
> then the unlock sequence in user space looks like this:
>
> 1) robust_list_set_op_pending(mutex);
> 2) robust_list_remove(mutex);
>
> lval = gettid();
> 3) if (atomic_try_cmpxchg(&mutex->lock, lval, 0))
> 4) robust_list_clear_op_pending();
> else
> 5) sys_futex(OP | FUTEX_ROBUST_UNLOCK, ....);
Ah!, see, your uapi patch earlier called that FUTEX_UNLOCK_ROBUST.
I'll fix it all up if I don't fine real issues.