All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: SeongJae Park <sj38.park@gmail.com>
Cc: corbet@lwn.net, dhowells@redhat.com, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Documentation/memory-barriers: fix wrong comment in example
Date: Sat, 20 Feb 2016 11:57:22 -0800	[thread overview]
Message-ID: <20160220195722.GG3522@linux.vnet.ibm.com> (raw)
In-Reply-To: <1455948068-14221-1-git-send-email-sj38.park@gmail.com>

On Sat, Feb 20, 2016 at 03:01:08PM +0900, SeongJae Park wrote:
> There is wrong comment in example for compiler store omit behavior.  It
> shows example of the problem and than problem solved version code.
> However, the comment in the solved version is still same with not solved
> version.  Fix the wrong statement with this commit.
> 
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>

Hmmm...  The code between the two stores of zero to "a" is intended to
remain the same in the broken and fixed versions.  So the only change
is from "a = 0" to "WRITE_ONCE(a, 0)".  Note that it is some other
CPU that did the third store to "a".

Or am I missing your point here?

							Thanx, Paul

> ---
>  Documentation/memory-barriers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> index 061ff29..b4754c7 100644
> --- a/Documentation/memory-barriers.txt
> +++ b/Documentation/memory-barriers.txt
> @@ -1471,7 +1471,7 @@ of optimizations:
>       wrong guess:
> 
>  	WRITE_ONCE(a, 0);
> -	/* Code that does not store to variable a. */
> +	/* Code that does store to variable a. */
>  	WRITE_ONCE(a, 0);
> 
>   (*) The compiler is within its rights to reorder memory accesses unless
> -- 
> 1.9.1
> 

  reply	other threads:[~2016-02-20 19:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20  6:01 [PATCH] Documentation/memory-barriers: fix wrong comment in example SeongJae Park
2016-02-20 19:57 ` Paul E. McKenney [this message]
2016-02-20 22:50   ` SeongJae Park
2016-02-21  5:25     ` Paul E. McKenney
2016-02-21  6:33       ` SeongJae Park
2016-02-22 10:01         ` David Howells
2016-02-22 11:08           ` SeongJae Park
2016-02-22 11:16             ` David Howells
2016-02-22 16:33               ` Paul E. McKenney
2016-02-22 21:45                 ` SeongJae Park

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=20160220195722.GG3522@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=corbet@lwn.net \
    --cc=dhowells@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj38.park@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.