From: Josef Bacik <jbacik@fusionio.com>
To: Liu Bo <liub.liubo@gmail.com>
Cc: Josef Bacik <JBacik@fusionio.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: barrier before waitqueue_active
Date: Thu, 2 Aug 2012 08:11:58 -0400 [thread overview]
Message-ID: <20120802121158.GF2263@localhost.localdomain> (raw)
In-Reply-To: <501A5A94.7070307@gmail.com>
On Thu, Aug 02, 2012 at 04:46:44AM -0600, Liu Bo wrote:
> On 08/02/2012 04:25 AM, Josef Bacik wrote:
> > We need an smb_mb() before waitqueue_active to avoid missing wakeups.
> > Before Mitch was hitting a deadlock between the ordered flushers and the
> > transaction commit because the ordered flushers were waiting for more refs
> > and were never woken up, so those smp_mb()'s are the most important.
> > Everything else I added for correctness sake and to avoid getting bitten by
> > this again somewhere else. Thanks,
> >
>
> Hi Josef,
>
> I'll appreciate a lot if you can add some comments for each memory
> barrier, because not everyone knows why it is used here and there. :)
>
I'm not going to add comments to all those places, you need a memory barrier in
places you don't have an implicit barrier before you do waitqueue_active because
you could miss somebody being added to the waitqueue, it's just basic
correctness. Thanks,
Josef
next prev parent reply other threads:[~2012-08-02 12:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 20:25 [PATCH] Btrfs: barrier before waitqueue_active Josef Bacik
2012-08-02 0:21 ` Mitch Harder
2012-08-03 14:43 ` Mitch Harder
2012-08-05 9:18 ` Arne Jansen
2012-08-02 10:46 ` Liu Bo
2012-08-02 12:11 ` Josef Bacik [this message]
2012-08-02 13:02 ` David Sterba
2012-08-02 13:01 ` cwillu
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=20120802121158.GF2263@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=liub.liubo@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.