From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936573AbcKNSjk (ORCPT ); Mon, 14 Nov 2016 13:39:40 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33500 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933571AbcKNSjd (ORCPT ); Mon, 14 Nov 2016 13:39:33 -0500 Date: Mon, 14 Nov 2016 10:39:26 -0800 From: "Paul E. McKenney" To: Pranith Kumar Cc: LKML , Ingo Molnar , Lai Jiangshan , Dipankar Sarma , Andrew Morton , Mathieu Desnoyers , Josh Triplett , Thomas Gleixner , Peter Zijlstra , Steven Rostedt , David Howells , Eric Dumazet , Darren Hart , Frederic Weisbecker , Oleg Nesterov Subject: Re: [PATCH tip/core/rcu 1/2] documentation: Present updated RCU guarantee Reply-To: paulmck@linux.vnet.ibm.com References: <20161114164649.GA15056@linux.vnet.ibm.com> <1479142030-15102-1-git-send-email-paulmck@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111418-8235-0000-0000-0000099CCC8E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006077; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00780636; UDB=6.00376456; IPR=6.00558137; BA=6.00004878; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013322; XFM=3.00000011; UTC=2016-11-14 18:39:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111418-8236-0000-0000-000036757C29 Message-Id: <20161114183926.GO4127@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-14_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611140368 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 14, 2016 at 11:57:46AM -0500, Pranith Kumar wrote: > Hi Paul, > > On Mon, Nov 14, 2016 at 11:47 AM, Paul E. McKenney > wrote: > > Recent memory-model work deduces the relationships of RCU read-side > > critical sections and grace periods based on the relationships of > > accesses within a critical section and accesses preceding and following > > the grace period. This commit therefore adds this viewpoint. > > > > Signed-off-by: Paul E. McKenney > > --- > > .../RCU/Design/Requirements/Requirements.html | 25 +++++++++++++++++++++- > > 1 file changed, 24 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/RCU/Design/Requirements/Requirements.html b/Documentation/RCU/Design/Requirements/Requirements.html > > index a4d3838130e4..81b40cb83435 100644 > > --- a/Documentation/RCU/Design/Requirements/Requirements.html > > +++ b/Documentation/RCU/Design/Requirements/Requirements.html > > @@ -547,7 +547,7 @@ The rcu_access_pointer() on line 6 is similar to > > It could reuse a value formerly fetched from this same pointer. > > It could also fetch the pointer from gp in a byte-at-a-time > > manner, resulting in load tearing, in turn resulting a bytewise > > - mash-up of two distince pointer values. > > + mash-up of two distinct pointer values. > > It might even use value-speculation optimizations, where it makes > > a wrong guess, but by the time it gets around to checking the > > value, an update has changed the pointer to match the wrong guess. > > @@ -659,6 +659,29 @@ systems with more than one CPU: > > In other words, a given instance of synchronize_rcu() > > can avoid waiting on a given RCU read-side critical section only > > if it can prove that synchronize_rcu() started first. > > + > > +

> > + A related question is “When rcu_read_lock() > > + doesn't generate any code, why does it matter how it relates > > + to a grace period?” > > + The answer if that it is not the relationship of > > s/if/is? Good catch, fixed! Thanx, Paul > > + rcu_read_lock() itself that is important, but rather > > + the relationship of the code within the enclosed RCU read-side > > + critical section to the code preceding and following the > > + grace period. > > + If we take this viewpoint, then a given RCU read-side critical > > + section begins before a given grace period when some access > > + preceding the grace period observes the effect of some access > > + within the critical section, in which case none of the accesses > > + within the critical section may observe the effects of any > > + access following the grace period. > > + > > +

> > + As of late 2016, mathematical models of RCU take this > > + viewpoint, for example, see slides 62 and 63 > > + of the > > + 2016 LinuxCon EU > > + presentation. > > > >   > > > > -- > > 2.5.2 > > > > > > -- > Pranith >