Received: by 10.223.185.116 with SMTP id b49csp8270037wrg; Thu, 1 Mar 2018 21:37:54 -0800 (PST) X-Google-Smtp-Source: AG47ELuHlgSUrWyDit+LpNzUJJdjeLdENwdeha6O8ciLP3tj1hPgHDzpgUOcL21ctmGgUK1L3p9B X-Received: by 10.101.92.196 with SMTP id b4mr3552764pgt.27.1519969074315; Thu, 01 Mar 2018 21:37:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519969074; cv=none; d=google.com; s=arc-20160816; b=w63atSVkuTizHVrk6bzUEEJTeQMl4Mkj7GLGQPrTaY8dVBRPtFnLXzAB6FE4hPt12i ZZXJMyJIuMbxtJU/1HFi+tC8EaaxdBxqxg5pjsv0F6Wu50aG4zZt7zmv9ydAZS7CGhOd 8zy+OiDTPGr5sCCrbfBlcLyERS/BGVvHa/udP5Ij0BB0WZvUcYC55rugxcu/CLEDA0IR A0WxZ9nFLGX3vVB675yBiCik/sHOJqPbZ4XAX7Y/QS3+QTR7nyYzn+J5ugF+RqB2k9w7 I6pnjMIdJQlqJQqdrLX2PFfIoYLE6qlfnkNZkYgzWuZJag9pS1m/0sby3CCqTwMnuzqb +4Dw== 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:arc-authentication-results; bh=q3Va9a0InuOQwepywrh32ZYd1v2GKaEfPCoayVL63hA=; b=PDQTELWPAUYWLZy8MCksQccHJEEHICGWFDI/vdx9yE60VPsKuP8nuiy486LeJ+PFJX zf0xKNvBcndaFIkl/H0VuemQQRGu9gC6L4zK/NVrO4wXSeBlqSN8ju+rXWf6HxsjIH6v Hbe5FlrhqUYmnkx5pTegwmf9aG+L/Ftcv2LMzUegrpVKVDYLHs6/BpzRy1qL1TzzZ8uI +YD5YWyji1H/b3jCIxLLppla9clnfVJK9dOVn+EtCQHBbnr+Uyfm3vjMq3aABBjTQ/qG +2L2yNIPvSa2f0e0kNMwKK9U0vDS3eWsvxQNEIJPMwhtC1piuAeanod99tbBxmz1Uuln cG5g== 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 94-v6si4254180ple.694.2018.03.01.21.37.39; Thu, 01 Mar 2018 21:37:54 -0800 (PST) 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 S1422738AbeCBEuA (ORCPT + 99 others); Thu, 1 Mar 2018 23:50:00 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33728 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164978AbeCBEtx (ORCPT ); Thu, 1 Mar 2018 23:49:53 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w224mtOm127350 for ; Thu, 1 Mar 2018 23:49:50 -0500 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gextcadkb-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 01 Mar 2018 23:49:50 -0500 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Mar 2018 23:49:49 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 1 Mar 2018 23:49:45 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w224niQb56557734; Fri, 2 Mar 2018 04:49:44 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2CE30B204E; Fri, 2 Mar 2018 00:52:01 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.80.201.246]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id E4688B2046; Fri, 2 Mar 2018 00:52:00 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 8E61D16C0EA7; Thu, 1 Mar 2018 20:50:15 -0800 (PST) Date: Thu, 1 Mar 2018 20:50:15 -0800 From: "Paul E. McKenney" To: Boqun Feng Cc: Alan Stern , LKMM Maintainers -- Akira Yokosawa , Andrea Parri , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Will Deacon , Kernel development list Subject: Re: [PATCH 2/2 v2 RFC] tools/memory-model: redefine rb in terms of rcu-fence Reply-To: paulmck@linux.vnet.ibm.com References: <20180301015531.olvuu5g35eta5xhr@tardis> <20180301174906.GC3777@linux.vnet.ibm.com> <20180301183758.GA31761@linux.vnet.ibm.com> <20180302043141.fgmjyysrws55pi7q@tardis> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180302043141.fgmjyysrws55pi7q@tardis> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18030204-0044-0000-0000-000003ED013B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008609; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00997107; UDB=6.00506974; IPR=6.00776425; MB=3.00019811; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-02 04:49:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030204-0045-0000-0000-0000081D0280 Message-Id: <20180302045015.GO3777@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-02_02:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803020054 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 02, 2018 at 12:31:41PM +0800, Boqun Feng wrote: > On Thu, Mar 01, 2018 at 10:37:58AM -0800, Paul E. McKenney wrote: > > On Thu, Mar 01, 2018 at 09:49:06AM -0800, Paul E. McKenney wrote: [ . . . ] > > And as Andrea pointed out off-list, I did indeed mess up Boqun's change. > > I forgot to change the "irreflexive" into "acyclic". Applying that change > > makes everything work. > > > > Please accept my apologies for my confusion! > > > > np, also I should have provided a proper patch for your testing. > > For this Alan's patch, feel free to add: > > Reviewed-by: Boqun Feng Alan's last submission was still RFC, so I have not yet queued it. So this ball is still in Alan's court. Thanx, Paul > Regards, > Boqun > > > Thanx, Paul > > > > > > > I prefer this because we already treat "gp" as "strong-fence", which > > > > > already is a "rcu-link". > > > > > > > > That's a good point; it had not occurred to me. > > > > > > And if I remove the "gp" but leave the last line, it does properly > > > classify the two new litmus tests. > > > > > > Thanx, Paul > > > > > > > > Also, recurisively extending rcu-fence with > > > > > itself is exactly calculating the transitive closure, which we can avoid > > > > > by using a "acycle" rule. Besides, it looks more consistent with hb and > > > > > pb. > > > > > > > > That _had_ occurred to me. But I couldn't see any way to do it while > > > > still defining rcu-fence correctly. > > > > > > ------------------------------------------------------------------------ > > > > > > diff --git a/tools/memory-model/linux-kernel.cat b/tools/memory-model/linux-kernel.cat > > > index 1e5c4653dd12..75d3c225146c 100644 > > > --- a/tools/memory-model/linux-kernel.cat > > > +++ b/tools/memory-model/linux-kernel.cat > > > @@ -106,12 +106,11 @@ let rcu-link = hb* ; pb* ; prop > > > * Any sequence containing at least as many grace periods as RCU read-side > > > * critical sections (joined by rcu-link) acts as a generalized strong fence. > > > *) > > > -let rec rcu-fence = gp | > > > +let rec rcu-fence = > > > (gp ; rcu-link ; rscs) | > > > (rscs ; rcu-link ; gp) | > > > (gp ; rcu-link ; rcu-fence ; rcu-link ; rscs) | > > > - (rscs ; rcu-link ; rcu-fence ; rcu-link ; gp) | > > > - (rcu-fence ; rcu-link ; rcu-fence) > > > + (rscs ; rcu-link ; rcu-fence ; rcu-link ; gp) > > > > > > (* rb orders instructions just as pb does *) > > > let rb = prop ; rcu-fence ; hb* ; pb* > >