From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Documentation/memory-barriers.txt: fix ACCESS_ONCE thinko
Date: Mon, 23 Nov 2015 15:07:26 -0800 [thread overview]
Message-ID: <20151123230726.GM26643@linux.vnet.ibm.com> (raw)
In-Reply-To: <1448316257-18246-1-git-send-email-cmetcalf@ezchip.com>
On Mon, Nov 23, 2015 at 05:04:17PM -0500, Chris Metcalf wrote:
> In commit 2ecf810121c7 ("Documentation/memory-barriers.txt: Add
> needed ACCESS_ONCE() calls to memory-barriers.txt") the statement
> "Q = P" was converted to "ACCESS_ONCE(Q) = P". This should have
> been "Q = ACCESS_ONCE(P)". It later became "WRITE_ONCE(Q, P)".
> This doesn't match the following text, which is "Q = LOAD P".
> Change the statement to be "Q = READ_ONCE(P)".
>
> Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Good eyes! Queued for v4.5.
Thanx, Paul
> ---
> Documentation/memory-barriers.txt | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> index aef9487303d0..85304ebd187c 100644
> --- a/Documentation/memory-barriers.txt
> +++ b/Documentation/memory-barriers.txt
> @@ -194,7 +194,7 @@ There are some minimal guarantees that may be expected of a CPU:
> (*) On any given CPU, dependent memory accesses will be issued in order, with
> respect to itself. This means that for:
>
> - WRITE_ONCE(Q, P); smp_read_barrier_depends(); D = READ_ONCE(*Q);
> + Q = READ_ONCE(P); smp_read_barrier_depends(); D = READ_ONCE(*Q);
>
> the CPU will issue the following memory operations:
>
> @@ -202,9 +202,9 @@ There are some minimal guarantees that may be expected of a CPU:
>
> and always in that order. On most systems, smp_read_barrier_depends()
> does nothing, but it is required for DEC Alpha. The READ_ONCE()
> - and WRITE_ONCE() are required to prevent compiler mischief. Please
> - note that you should normally use something like rcu_dereference()
> - instead of open-coding smp_read_barrier_depends().
> + is required to prevent compiler mischief. Please note that you
> + should normally use something like rcu_dereference() instead of
> + open-coding smp_read_barrier_depends().
>
> (*) Overlapping loads and stores within a particular CPU will appear to be
> ordered within that CPU. This means that for:
> --
> 2.1.2
>
prev parent reply other threads:[~2015-11-23 23:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 22:04 [PATCH] Documentation/memory-barriers.txt: fix ACCESS_ONCE thinko Chris Metcalf
2015-11-23 23:07 ` Paul E. McKenney [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=20151123230726.GM26643@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=cmetcalf@ezchip.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@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