lkml.org 
[lkml]   [2020]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch V2 11/15] completion: Use simple wait queues
Date
Joel,

Joel Fernandes <joel@joelfernandes.org> writes:
> On Wed, Mar 18, 2020 at 09:43:13PM +0100, Thomas Gleixner wrote:
>> The spinlock in the wait queue head cannot be replaced by a raw_spinlock
>> because:
>>
>> - wait queues can have custom wakeup callbacks, which acquire other
>> spinlock_t locks and have potentially long execution times
>
> Cool, makes sense.
>
>> - wake_up() walks an unbounded number of list entries during the wake up
>> and may wake an unbounded number of waiters.
>
> Just to clarify here, wake_up() will really wake up just 1 waiter if all the
> waiters on the queue are exclusive right? So in such scenario at least, the
> "unbounded number of waiters" would not be an issue if everything waiting was
> exclusive and waitqueue with wake_up() was used. Please correct me if I'm
> wrong about that though.

Correct.

> So the main reasons to avoid waitqueue in favor of swait (as you mentioned)
> would be the sleep-while-atomic issue in truly atomic context on RT, and the
> fact that callbacks can take a long time.

Yes.

Thanks,

tglx

\
 
 \ /
  Last update: 2020-03-19 01:46    [W:0.053 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site