From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752198AbcBVQdc (ORCPT ); Mon, 22 Feb 2016 11:33:32 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:46033 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751447AbcBVQda (ORCPT ); Mon, 22 Feb 2016 11:33:30 -0500 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-doc@vger.kernel.org;linux-kernel@vger.kernel.org Date: Mon, 22 Feb 2016 08:33:22 -0800 From: "Paul E. McKenney" To: David Howells Cc: SeongJae Park , Jonathan Corbet , linux-doc , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] Documentation/memory-barriers: fix wrong comment in example Message-ID: <20160222163322.GU3522@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1455948068-14221-1-git-send-email-sj38.park@gmail.com> <20160220195722.GG3522@linux.vnet.ibm.com> <20160221052542.GJ3522@linux.vnet.ibm.com> <26215.1456135273@warthog.procyon.org.uk> <30870.1456139799@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30870.1456139799@warthog.procyon.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022216-0005-0000-0000-00001CA7287C Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22, 2016 at 11:16:39AM +0000, David Howells wrote: > SeongJae Park wrote: > > > From f7b5677790771599f418f1d95536935be971ae86 Mon Sep 17 00:00:00 2001 > > From: SeongJae Park > > Date: Mon, 22 Feb 2016 19:26:18 +0900 > > Subject: [PATCH] Documentation/memory-barriers: polish compiler store omit > > example > > > > Comments of examples about compiler store omit in memory-barriers.txt is > > about code that could be possible at that point. However, someone could > > interpret the comment as an explanation about below line. This commit > > exploits the intent more explicitly by changing the comment to be seems > > like a possible code rather than explanation about below line. > > > > Signed-off-by: SeongJae Park > > --- > > Documentation/memory-barriers.txt | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/memory-barriers.txt > > b/Documentation/memory-barriers.txt > > index 904ee42..dc66351 100644 > > --- a/Documentation/memory-barriers.txt > > +++ b/Documentation/memory-barriers.txt > > @@ -1459,7 +1459,7 @@ of optimizations: > > the following: > > > > a = 0; > > - /* Code that does not store to variable a. */ > > + ... Code that does not store to variable a ... > > a = 0; > > > > The compiler sees that the value of variable 'a' is already zero, so > > @@ -1471,7 +1471,7 @@ of optimizations: > > wrong guess: > > > > WRITE_ONCE(a, 0); > > - /* Code that does not store to variable a. */ > > + ... Code that does not store to variable a ... > > WRITE_ONCE(a, 0); > > > > (*) The compiler is within its rights to reorder memory accesses unless > > Acked-by: David Howells Thank you both! Patch with updated commit log below, please let me know if you have any objections to the changes. Thanx, Paul ------------------------------------------------------------------------ commit 0a41feb6ab4da3218192e2cde1a54fcc5d8f5658 Author: SeongJae Park Date: Mon Feb 22 08:28:29 2016 -0800 documentation: Clarify compiler store-fusion example The compiler store-fusion example in memory-barriers.txt uses a C comment to represent arbitrary code that does not update a given variable. Unfortunately, someone could reasonably interpret the comment as instead referring to the following line of code. This commit therefore replaces the comment with a string that more clearly represents the arbitrary code. Signed-off-by: SeongJae Park Acked-by: David Howells Signed-off-by: Paul E. McKenney diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 8367d393cba2..3729cbe60e41 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt @@ -1550,7 +1550,7 @@ of optimizations: the following: a = 0; - /* Code that does not store to variable a. */ + ... Code that does not store to variable a ... a = 0; The compiler sees that the value of variable 'a' is already zero, so @@ -1562,7 +1562,7 @@ of optimizations: wrong guess: WRITE_ONCE(a, 0); - /* Code that does not store to variable a. */ + ... Code that does not store to variable a ... WRITE_ONCE(a, 0); (*) The compiler is within its rights to reorder memory accesses unless