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

2020-03-20 Thread Davidlohr Bueso
On Wed, 18 Mar 2020, Thomas Gleixner wrote: From: Thomas Gleixner completion uses a wait_queue_head_t to enqueue waiters. wait_queue_head_t contains a spinlock_t to protect the list of waiters which excludes it from being used in truly atomic context on a PREEMPT_RT enabled kernel. The spinl

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

2020-03-20 Thread Christoph Hellwig
On Fri, Mar 20, 2020 at 10:25:41AM +1100, Julian Calaby wrote: > > +++ b/drivers/usb/gadget/function/f_fs.c > > @@ -1703,7 +1703,7 @@ static void ffs_data_put(struct ffs_data > > pr_info("%s(): freeing\n", __func__); > > ffs_data_clear(ffs); > > BUG_O

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

2020-03-19 Thread Julian Calaby
Hi Thomas, On Thu, Mar 19, 2020 at 7:48 AM Thomas Gleixner wrote: > > From: Thomas Gleixner > > completion uses a wait_queue_head_t to enqueue waiters. > > wait_queue_head_t contains a spinlock_t to protect the list of waiters > which excludes it from being used in truly atomic context on a PREE

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

2020-03-19 Thread Linus Torvalds
On Wed, Mar 18, 2020 at 1:47 PM Thomas Gleixner wrote: > > There is no semantical or functional change: Ack, with just the explanation, I'm no longer objecting to this. Plus you fixed and cleaned up the odd usb gadget code separately (well, most of it). Linus

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

2020-03-19 Thread Greg Kroah-Hartman
On Wed, Mar 18, 2020 at 09:43:13PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > completion uses a wait_queue_head_t to enqueue waiters. > > wait_queue_head_t contains a spinlock_t to protect the list of waiters > which excludes it from being used in truly atomic context on a PREEMPT

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

2020-03-18 Thread Thomas Gleixner
Joel, Joel Fernandes 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 pot

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

2020-03-18 Thread Joel Fernandes
Hi Thomas, On Wed, Mar 18, 2020 at 09:43:13PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > completion uses a wait_queue_head_t to enqueue waiters. > > wait_queue_head_t contains a spinlock_t to protect the list of waiters > which excludes it from being used in truly atomic context

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

2020-03-18 Thread Logan Gunthorpe
On 2020-03-18 2:43 p.m., Thomas Gleixner wrote: > There is no semantical or functional change: > > - completions use the exclusive wait mode which is what swait provides > > - complete() wakes one exclusive waiter > > - complete_all() wakes all waiters while holding the lock which prote

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

2020-03-18 Thread Thomas Gleixner
From: Thomas Gleixner completion uses a wait_queue_head_t to enqueue waiters. wait_queue_head_t contains a spinlock_t to protect the list of waiters which excludes it from being used in truly atomic context on a PREEMPT_RT enabled kernel. The spinlock in the wait queue head cannot be replaced b