Re: [PATCH] Btrfs: avoid wake_up if possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> > 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(), but these two
> > are the hottest one I've run into so far.
> > 
> > Signed-off-by: Liu Bo <bo.li.liu@xxxxxxxxxx>
> 
> Can you please split the patch and address both separately, as they are
> not affecting the same data structure? It would be good to mention the
> other parts of code specifically (not just "around some code"), or
> briefly describe the state transitions where it matters for the wake
> ups.
>

OK.

> A missed wakeup appears as if the system is hung, but it's not a
> deadlock and we don't have much help debugging that when it happens. I'd
> like to review that in a way where I can make sure you have checked all
> the possible lost wakeups.

Good point, but it seems that we could only prove it on code level
(like the comments put around the code).

-liubo
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux