From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754678AbcBVLQs (ORCPT ); Mon, 22 Feb 2016 06:16:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37013 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754606AbcBVLQm (ORCPT ); Mon, 22 Feb 2016 06:16:42 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: 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> To: SeongJae Park Cc: dhowells@redhat.com, Paul McKenney , Jonathan Corbet , linux-doc , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] Documentation/memory-barriers: fix wrong comment in example MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30869.1456139799.1@warthog.procyon.org.uk> Date: Mon, 22 Feb 2016 11:16:39 +0000 Message-ID: <30870.1456139799@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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