lkml.org 
[lkml]   [2021]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 58/63] futex: Prevent requeue_pi() lock nesting issue on RT
Date
On Tue, Aug 03 2021 at 12:28, Peter Zijlstra wrote:

> On Mon, Aug 02, 2021 at 02:56:09PM +0200, Peter Zijlstra wrote:
>> static inline void futex_requeue_pi_complete(struct futex_q *q, int locked)
>> {
>> + int old, new;
>>
>> + old = atomic_read_acquire(&q->requeue_state);
>> + do {
>
> if (old == Q_REQUEUE_PI_IGNORE)
> return;
>
>> if (locked >= 0) {
>
> WARN_ON_ONCE(old != Q_REQUEUE_PI_IN_PROGRESS &&
> old != Q_REQUEUE_PI_WAIT)
>
>> /* Requeue succeeded. Set DONE or LOCKED */
>> new = Q_REQUEUE_PI_DONE + locked;
>> + } else if (old == Q_REQUEUE_PI_IN_PROGRESS) {
>> /* Deadlock, no early wakeup interleave */
>> new = Q_REQUEUE_PI_NONE;
>> } else {
>
> WARN_ON_ONCE(old != Q_REQUEUE_PI_WAIT);
>
>
> I think...

Yes, it's matching the valid transition table.

Thanks,

tglx

\
 
 \ /
  Last update: 2021-08-03 23:11    [W:0.073 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site