From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: paulmck@linux.ibm.com, Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Biggers <ebiggers@kernel.org>,
"Tobin C. Harding" <me@tobin.cc>,
linux-fsdevel@vger.kernel.org
Subject: Re: dcache locking question
Date: Sat, 16 Mar 2019 19:20:20 -0700 [thread overview]
Message-ID: <1552789220.6551.13.camel@HansenPartnership.com> (raw)
In-Reply-To: <20190317005005.GY4102@linux.ibm.com>
On Sat, 2019-03-16 at 17:50 -0700, Paul E. McKenney wrote:
[...]
> I -have- seen stores of constant values be torn, but not stores of
> runtime-variable values and not loads. Still, such tearing is
> permitted, and including the READ_ONCE() is making it easier for
> things like thread sanitizers. In addition, the READ_ONCE() makes it
> clear that the value being loaded is unstable, which can be
> useful documentation.
Um, just so I'm clear, because this assumption permeates all our code:
load or store tearing can never occur if we're doing load or store of a
32 bit value which is naturally aligned. Where naturally aligned is
within the gift of the CPU to determine but which the compiler or
kernel will always ensure for us unless we pack the structure or
deliberately misalign the allocation.
James
next prev parent reply other threads:[~2019-03-17 2:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 22:56 dcache locking question Tobin C. Harding
2019-03-14 23:09 ` Matthew Wilcox
2019-03-15 1:38 ` Tobin C. Harding
2019-03-14 23:19 ` Tobin C. Harding
2019-03-15 1:50 ` Al Viro
2019-03-15 17:38 ` Eric Biggers
2019-03-15 18:54 ` Al Viro
2019-03-16 22:31 ` Paul E. McKenney
2019-03-17 0:18 ` Al Viro
2019-03-17 0:50 ` Paul E. McKenney
2019-03-17 2:20 ` James Bottomley [this message]
2019-03-17 3:06 ` Al Viro
2019-03-17 4:23 ` James Bottomley
2019-03-18 0:35 ` Paul E. McKenney
2019-03-18 16:26 ` James Bottomley
2019-03-18 17:11 ` Paul E. McKenney
2019-03-19 15:45 ` Paul E. McKenney
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=1552789220.6551.13.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=ebiggers@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=me@tobin.cc \
--cc=paulmck@linux.ibm.com \
--cc=viro@zeniv.linux.org.uk \
/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).