From: Liu Bo <bo.li.liu@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: avoid wake_up if possible
Date: Wed, 6 Sep 2017 17:48:10 -0700 [thread overview]
Message-ID: <20170907004810.GD16924@lim.localdomain> (raw)
In-Reply-To: <20170906141904.GN31874@twin.jikos.cz>
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@oracle.com>
>
> 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
prev parent reply other threads:[~2017-09-07 0:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 22:14 [PATCH] Btrfs: avoid wake_up if possible Liu Bo
2017-09-06 14:19 ` David Sterba
2017-09-07 0:48 ` Liu Bo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170907004810.GD16924@lim.localdomain \
--to=bo.li.liu@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).