From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759326AbcBTT5Z (ORCPT ); Sat, 20 Feb 2016 14:57:25 -0500 Received: from e18.ny.us.ibm.com ([129.33.205.208]:41249 "EHLO e18.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751720AbcBTT5W (ORCPT ); Sat, 20 Feb 2016 14:57:22 -0500 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-doc@vger.kernel.org;linux-kernel@vger.kernel.org Date: Sat, 20 Feb 2016 11:57:22 -0800 From: "Paul E. McKenney" To: SeongJae Park 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 Message-ID: <20160220195722.GG3522@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1455948068-14221-1-git-send-email-sj38.park@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455948068-14221-1-git-send-email-sj38.park@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022019-0045-0000-0000-000003646DA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 >