From: "Paul E. McKenney" <paulmck@kernel.org>
To: SeongJae Park <sj38.park@gmail.com>
Cc: corbet@lwn.net, SeongJae Park <sjpark@amazon.de>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] Documentation/memory-barriers: Fix typos
Date: Fri, 31 Jan 2020 13:23:49 -0800 [thread overview]
Message-ID: <20200131212349.GY2935@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20200131205237.29535-6-sj38.park@gmail.com>
On Fri, Jan 31, 2020 at 09:52:37PM +0100, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
>
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
Good catches, queued, thank you!
But if Jon would rather take this:
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
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 ec3b5865c1be..01ab5e22b670 100644
> --- a/Documentation/memory-barriers.txt
> +++ b/Documentation/memory-barriers.txt
> @@ -185,7 +185,7 @@ As a further example, consider this sequence of events:
> =============== ===============
> { A == 1, B == 2, C == 3, P == &A, Q == &C }
> B = 4; Q = P;
> - P = &B D = *Q;
> + P = &B; D = *Q;
>
> There is an obvious data dependency here, as the value loaded into D depends on
> the address retrieved from P by CPU 2. At the end of the sequence, any of the
> @@ -569,7 +569,7 @@ following sequence of events:
> { A == 1, B == 2, C == 3, P == &A, Q == &C }
> B = 4;
> <write barrier>
> - WRITE_ONCE(P, &B)
> + WRITE_ONCE(P, &B);
> Q = READ_ONCE(P);
> D = *Q;
>
> @@ -1721,7 +1721,7 @@ of optimizations:
> and WRITE_ONCE() are more selective: With READ_ONCE() and
> WRITE_ONCE(), the compiler need only forget the contents of the
> indicated memory locations, while with barrier() the compiler must
> - discard the value of all memory locations that it has currented
> + discard the value of all memory locations that it has currently
> cached in any machine registers. Of course, the compiler must also
> respect the order in which the READ_ONCE()s and WRITE_ONCE()s occur,
> though the CPU of course need not do so.
> @@ -1833,7 +1833,7 @@ Aside: In the case of data dependencies, the compiler would be expected
> to issue the loads in the correct order (eg. `a[b]` would have to load
> the value of b before loading a[b]), however there is no guarantee in
> the C specification that the compiler may not speculate the value of b
> -(eg. is equal to 1) and load a before b (eg. tmp = a[1]; if (b != 1)
> +(eg. is equal to 1) and load a[b] before b (eg. tmp = a[1]; if (b != 1)
> tmp = a[b]; ). There is also the problem of a compiler reloading b after
> having loaded a[b], thus having a newer copy of b than a[b]. A consensus
> has not yet been reached about these problems, however the READ_ONCE()
> --
> 2.17.1
>
next prev parent reply other threads:[~2020-01-31 21:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-31 20:52 [PATCH 0/5] Documentation: Fix trivial nits SeongJae Park
2020-01-31 20:52 ` [PATCH 1/5] docs/locking: Fix outdated section names SeongJae Park
2020-01-31 20:52 ` [PATCH 2/5] docs/ko_KR/howto: Insert missing dots SeongJae Park
2020-02-05 17:15 ` Jonathan Corbet
2020-02-06 0:12 ` SeongJae Park
2020-01-31 20:52 ` [PATCH 3/5] Documentation/ko_KR/howto: Update broken web addresses SeongJae Park
2020-01-31 20:52 ` [PATCH 4/5] Documentation/ko_KR/howto: Update a broken link SeongJae Park
2020-01-31 20:52 ` [PATCH 5/5] Documentation/memory-barriers: Fix typos SeongJae Park
2020-01-31 21:23 ` Paul E. McKenney [this message]
2020-02-05 17:22 ` [PATCH 0/5] Documentation: Fix trivial nits Jonathan Corbet
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=20200131212349.GY2935@paulmck-ThinkPad-P72 \
--to=paulmck@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sj38.park@gmail.com \
--cc=sjpark@amazon.de \
/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).