Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5367418imd; Tue, 30 Oct 2018 16:45:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5cJBjHVYZimPiUKeKHOObyBJgw/8tlJ2tPCQLmyhmohm/UbX0IUA5yx+buwN658lRcz7PIl X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10-v6mr810800plb.214.1540943156543; Tue, 30 Oct 2018 16:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540943156; cv=none; d=google.com; s=arc-20160816; b=kf/7cjp2xX7Hi6H2JMKCEx2//rHdb75pekmjXold572Y+gzYcnEGo16HwsAUpQKWel +5nJED9XNx1GTjVVHtEHt/Z7y7CglHBYuWyNUe+4n9iVk294dbsYbogaqlTmdr8XLhLz I+0EKiy0nQRrGHt/nb86nwCL+9GgDCSchW59AJ6Msw3HA8fBo/SByZN0wb5AvTWhZTR2 GLWmjQAWrIaixRQTzbdcuYq9YU6u0NDr1QhbBvooheSGnN5AgY2bL8kbX8GePFcRriAw 9YjJTFe6QGgjT6G9J5PS6IfwVaHxowYYaMvlBLBqXRA+PN9X/lapENE8SRzDUOjBwCu8 +axw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=ffvE+28TnhnbUHeTwlxF2+IbPiFGnB22WKrVurRS7jU=; b=Cik2MiOV2lF1eqj4z0znMS/g+5AEl8Rp4M9Zkcanv57ZJIRVGUdIvXVFBgX7X9WNXk rOeKMgbkPDobJxl0aAHt4UA2slHYWitqrJPl9L/JdVqhpSF0Av24p8iNE06SX1DemWRS c3Tgtfz1BrdQwzVPBHtP1xJLRqAZFR8jUnF1AlZ3BLkJGxQT2tqfOz+HRJDNlXFsJ8Dx yrFjOGhQHCUpnaQZQWTGH8Hlcy2o47gXYZ7MeoHu0jHFTD3U+lhGX/CqFdEPYAnE5o/9 ZZxP8b8rmTLvtUwjidZsCO4ic4j47qekk0p4prUM6o/l9RYgAwPyySaVTXobW7vsFWkn B7oQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q33-v6si24247083pgk.2.2018.10.30.16.45.40; Tue, 30 Oct 2018 16:45:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728225AbeJaIjS (ORCPT + 99 others); Wed, 31 Oct 2018 04:39:18 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41078 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727683AbeJaIjR (ORCPT ); Wed, 31 Oct 2018 04:39:17 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9UNYUqB006875 for ; Tue, 30 Oct 2018 19:43:40 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2nex1jpsh3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 Oct 2018 19:43:40 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Oct 2018 23:43:40 -0000 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 30 Oct 2018 23:43:37 -0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9UNhbJG3932574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Oct 2018 23:43:37 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05F2EB2065; Tue, 30 Oct 2018 23:43:37 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C9B74B2064; Tue, 30 Oct 2018 23:43:36 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.141]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 30 Oct 2018 23:43:36 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id D748B16C0276; Tue, 30 Oct 2018 16:43:36 -0700 (PDT) Date: Tue, 30 Oct 2018 16:43:36 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: linux-kernel@vger.kernel.org Subject: Re: [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu Reply-To: paulmck@linux.ibm.com References: <20181028043046.198403-1-joel@joelfernandes.org> <20181030222649.GA105735@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181030222649.GA105735@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18103023-2213-0000-0000-0000030E1900 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009956; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01110353; UDB=6.00575327; IPR=6.00890445; MB=3.00023971; MTD=3.00000008; XFM=3.00000015; UTC=2018-10-30 23:43:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18103023-2214-0000-0000-00005C157F16 Message-Id: <20181030234336.GW4170@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-30_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810300196 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 30, 2018 at 03:26:49PM -0700, Joel Fernandes wrote: > Hi Paul, > > On Sat, Oct 27, 2018 at 09:30:46PM -0700, Joel Fernandes (Google) wrote: > > As per this thread [1], it seems this smp_mb isn't needed anymore: > > "So the smp_mb() that I was trying to add doesn't need to be there." > > > > So let us remove this part from the memory ordering documentation. > > > > [1] https://lkml.org/lkml/2017/10/6/707 > > > > Signed-off-by: Joel Fernandes (Google) > > I was just checking about this patch. Do you feel it is correct to remove > this part from the docs? Are you satisified that a barrier isn't needed there > now? Or did I miss something? Apologies, it got lost in the shuffle. I have now applied it with a bit of rework to the commit log, thank you! Thanx, Paul > thanks, > > - Joel > > > > --- > > .../Tree-RCU-Memory-Ordering.html | 32 +------------------ > > 1 file changed, 1 insertion(+), 31 deletions(-) > > > > diff --git a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html > > index a346ce0116eb..0fb1511763d4 100644 > > --- a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html > > +++ b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html > > @@ -77,7 +77,7 @@ The key point is that the lock-acquisition functions, including > > smp_mb__after_unlock_lock() immediately after successful > > acquisition of the lock. > > > > -

Therefore, for any given rcu_node struction, any access > > +

Therefore, for any given rcu_node structure, any access > > happening before one of the above lock-release functions will be seen > > by all CPUs as happening before any access happening after a later > > one of the above lock-acquisition functions. > > @@ -162,36 +162,6 @@ an atomic_add_return() of zero) to detect idle CPUs. > >   > > > > > > -

The approach must be extended to handle one final case, that > > -of waking a task blocked in synchronize_rcu(). > > -This task might be affinitied to a CPU that is not yet aware that > > -the grace period has ended, and thus might not yet be subject to > > -the grace period's memory ordering. > > -Therefore, there is an smp_mb() after the return from > > -wait_for_completion() in the synchronize_rcu() > > -code path. > > - > > - > > - > > - > > - > > - > > - > > - > > -
 
Quick Quiz:
> > - What? Where??? > > - I don't see any smp_mb() after the return from > > - wait_for_completion()!!! > > -
Answer:
> > - That would be because I spotted the need for that > > - smp_mb() during the creation of this documentation, > > - and it is therefore unlikely to hit mainline before v4.14. > > - Kudos to Lance Roy, Will Deacon, Peter Zijlstra, and > > - Jonathan Cameron for asking questions that sensitized me > > - to the rather elaborate sequence of events that demonstrate > > - the need for this memory barrier. > > -
 
> > - > >

Tree RCU's grace--period memory-ordering guarantees rely most > > heavily on the rcu_node structure's ->lock > > field, so much so that it is necessary to abbreviate this pattern > > -- > > 2.19.1.568.g152ad8e336-goog > > >