Re: [patch V2 11/15] completion: Use simple wait queues

From
Thomas Gleixner <hidden>
Date
2020-03-19 00:45:14
Also in
linux-pci, linux-usb, linuxppc-dev, lkml, netdev
Reply to
Joel Fernandes, 2020-03-19
Joel,

Joel Fernandes [off-list ref] writes:
On Wed, Mar 18, 2020 at 09:43:13PM +0100, Thomas Gleixner wrote:
quoted
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.
quoted
  - 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
Thread (72 messages) 72 messages, 17 authors, last reply 2020-03-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help