From: keith.busch@linux.intel.com (Keith Busch)
Subject: [PATCH] Bugfix for handling of shadow doorbell buffer.
Date: Tue, 14 Aug 2018 17:49:40 -0600 [thread overview]
Message-ID: <20180814234940.GB3224@localhost.localdomain> (raw)
In-Reply-To: <CA+55aFw-Fed2QJCYBosGby71AsXAVKGq8mG-HYR13rEnD9V2Lg@mail.gmail.com>
On Tue, Aug 14, 2018@04:16:41PM -0700, Linus Torvalds wrote:
> On Tue, Aug 14, 2018@3:56 PM Keith Busch <keith.busch@linux.intel.com> wrote:
> >
> > You just want to ensure the '*dbbuf_db = value' isn't reordered, right?
> > The order dependency might be more obvious if done as:
> >
> > WRITE_ONCE(*dbbuf_db, value);
> >
> > if (!nvme_dbbuf_need_event(READ_ONCE(*dbbuf_ei), value, old_value))
> > return false;
> >
> > And 'volatile' is again redundant.
>
> Yes, using READ_ONCE/WRITE_ONCE obviates the need for volatile, but it
> does *not* impose a memory ordering.
>
> It imposes an ordering on the compiler, but not on the CPU, so you
> still want the "mb()" there
I mistakenly recalled memory-barriers.txt mentioned order was enforced
on the CPU, but that's true only for overlapping memory, which this is
not. Thanks for the correction.
next prev parent reply other threads:[~2018-08-14 23:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 22:17 [PATCH] Bugfix for handling of shadow doorbell buffer Michal Wnukowski
2018-08-14 22:57 ` Keith Busch
2018-08-14 23:16 ` Linus Torvalds
2018-08-14 23:49 ` Keith Busch [this message]
2018-08-15 1:35 ` Michal Wnukowski
2018-08-15 2:02 ` Linus Torvalds
2018-08-15 22:51 ` [PATCH v2] " Michal Wnukowski
2018-08-16 14:15 ` Keith Busch
2018-08-16 21:20 ` Sagi Grimberg
2018-08-17 7:07 ` Christoph Hellwig
2018-08-20 20:09 ` Michal Wnukowski
2018-08-17 7:10 ` [PATCH] " Christoph Hellwig
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=20180814234940.GB3224@localhost.localdomain \
--to=keith.busch@linux.intel.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 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).