Re: [patch 58/63] futex: Prevent requeue_pi() lock nesting issue on RT

From: Thomas Gleixner
Date: Mon Aug 02 2021 - 10:34:42 EST


On Mon, Aug 02 2021 at 14:56, Peter Zijlstra wrote:
> On Fri, Jul 30, 2021 at 03:51:05PM +0200, Thomas Gleixner wrote:
> I did:
>
> - atomic_cmpxchg() -> atomic_try_cmpxchg()

Ack.

> - atomic_read() -> atomic_read_acquire(); which I think is required for
> at least the futex_requeue_pi_wakeup_sync() >= Q_REQUEUE_PI_DONE case
> to ensure we observe the state as per whoever set DONE/LOCKED.

Indeed

> - use atomic_cond_read_relaxed()

Cute

> - removed one ternary operator for (IMO) clearer code.

It's definitely more readable this way.

Thanks,

tglx