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 13:20, Peter Zijlstra wrote:
> On Fri, Jul 30, 2021 at 03:51:05PM +0200, Thomas Gleixner wrote:
>> + /*
>> + * We were woken prior to requeue by a timeout or a signal.
>> + * Unqueue the futex_q and determine which it was.
>> + */
>> + plist_del(&q->list, &hb->chain);
>> + hb_waiters_dec(hb);
>> +
>> + /* Handle spurious wakeups gracefully */
>> + ret = -EWOULDBLOCK;
>> + if (timeout && !timeout->task)
>> + ret = -ETIMEDOUT;
>> + else if (signal_pending(current))
>> + ret = -ERESTARTNOINTR;
>> return ret;
>> }
>
> AFAICT this change is a separate cleanup, possible because the only
> callsite already does that match_futex() test before calling this.

No. It's possible because the state machine guarantees that. The
match_futex() in the calling function is unrelated.

> I think it might be worth splitting out, just to reduce the complexity
> of this patch.

Yes, I did by moving the match_futex() test to the call site as a
preparatory change for this one.

Thanks,

tglx

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