From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Pranith Kumar <bobby.prani@gmail.com>
Cc: Randy Dunlap <rdunlap@infradead.org>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] doc: memory-barriers.txt: Correct example for reorderings
Date: Wed, 3 Sep 2014 08:07:51 -0700 [thread overview]
Message-ID: <20140903150751.GV5001@linux.vnet.ibm.com> (raw)
In-Reply-To: <1409715269-17390-1-git-send-email-bobby.prani@gmail.com>
On Tue, Sep 02, 2014 at 11:34:29PM -0400, Pranith Kumar wrote:
> Correct the example of memory orderings in memory-barriers.txt
>
> Commit 615cc2c9cf95 "Documentation/memory-barriers.txt: fix important typo re
> memory barriers" changed the assignment to x and y. Change the rest of the
> example to match this change.
>
> Reported-by: Ganesh Rapolu <ganesh.rapolu@hotmail.com>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Queued, thank you!
Thanx, Paul
> ---
> Documentation/memory-barriers.txt | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> index a4de88f..02f5de8 100644
> --- a/Documentation/memory-barriers.txt
> +++ b/Documentation/memory-barriers.txt
> @@ -121,22 +121,22 @@ For example, consider the following sequence of events:
> The set of accesses as seen by the memory system in the middle can be arranged
> in 24 different combinations:
>
> - STORE A=3, STORE B=4, x=LOAD A->3, y=LOAD B->4
> - STORE A=3, STORE B=4, y=LOAD B->4, x=LOAD A->3
> - STORE A=3, x=LOAD A->3, STORE B=4, y=LOAD B->4
> - STORE A=3, x=LOAD A->3, y=LOAD B->2, STORE B=4
> - STORE A=3, y=LOAD B->2, STORE B=4, x=LOAD A->3
> - STORE A=3, y=LOAD B->2, x=LOAD A->3, STORE B=4
> - STORE B=4, STORE A=3, x=LOAD A->3, y=LOAD B->4
> + STORE A=3, STORE B=4, y=LOAD A->3, x=LOAD B->4
> + STORE A=3, STORE B=4, x=LOAD B->4, y=LOAD A->3
> + STORE A=3, y=LOAD A->3, STORE B=4, x=LOAD B->4
> + STORE A=3, y=LOAD A->3, x=LOAD B->2, STORE B=4
> + STORE A=3, x=LOAD B->2, STORE B=4, y=LOAD A->3
> + STORE A=3, x=LOAD B->2, y=LOAD A->3, STORE B=4
> + STORE B=4, STORE A=3, y=LOAD A->3, x=LOAD B->4
> STORE B=4, ...
> ...
>
> and can thus result in four different combinations of values:
>
> - x == 1, y == 2
> - x == 1, y == 4
> - x == 3, y == 2
> - x == 3, y == 4
> + x == 2, y == 1
> + x == 2, y == 3
> + x == 4, y == 1
> + x == 4, y == 3
>
>
> Furthermore, the stores committed by a CPU to the memory system may not be
> --
> 2.1.0
>
prev parent reply other threads:[~2014-09-03 15:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 3:34 [PATCH v2] doc: memory-barriers.txt: Correct example for reorderings Pranith Kumar
2014-09-03 15: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=20140903150751.GV5001@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=bobby.prani@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.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