Re: [PATCH] Btrfs: avoid wake_up if possible

2017-09-06 Thread Liu Bo
On Wed, Sep 06, 2017 at 04:19:04PM +0200, David Sterba wrote: > On Fri, Sep 01, 2017 at 04:14:27PM -0600, Liu Bo wrote: > > wake_up() will go to check whether someone is on the waiting list with > > holding spin_lock(). > > > > Around some btrfs code, we don't check waitqueue_active() firstly, so >

Re: [PATCH] Btrfs: avoid wake_up if possible

2017-09-06 Thread David Sterba
On Fri, Sep 01, 2017 at 04:14:27PM -0600, Liu Bo wrote: > wake_up() will go to check whether someone is on the waiting list with > holding spin_lock(). > > Around some btrfs code, we don't check waitqueue_active() firstly, so > the spin_lock() pair in wake_up() is called even if no one is waiting >

[PATCH] Btrfs: avoid wake_up if possible

2017-09-01 Thread Liu Bo
wake_up() will go to check whether someone is on the waiting list with holding spin_lock(). Around some btrfs code, we don't check waitqueue_active() firstly, so the spin_lock() pair in wake_up() is called even if no one is waiting on the queue. There are more wake_up()s without waitqueue_active(