Re: [RFC PATCH] futex: Introduce __vdso_robust_futex_unlock

From: Florian Weimer

Date: Thu Mar 12 2026 - 04:50:35 EST


* Mathieu Desnoyers:

> + * This vDSO unlocks the robust futex by exchanging the content of
> + * *uaddr with 0 with a store-release semantic. If the futex has
> + * waiters, it sets bit 1 of *op_pending_addr, else it clears
> + * *op_pending_addr. Those operations are within a code region
> + * known by the kernel, making them safe with respect to asynchronous
> + * program termination either from thread context or from a nested
> + * signal handler.
> + *
> + * Expected use of this vDSO:
> + *
> + * if ((__vdso_robust_futex_unlock((u32 *) &mutex->__data.__lock, &pd->robust_head.list_op_pending)
> + * & FUTEX_WAITERS) != 0)
> + * futex_wake((u32 *) &mutex->__data.__lock, 1, private);
> + * WRITE_ONCE(pd->robust_head.list_op_pending, 0);

The comment could perhaps say that pd->robust_head is the
thread-specific robust list that has been registered with
set_robust_list.

Thanks,
Florian