Received: by 10.223.185.116 with SMTP id b49csp867948wrg; Fri, 16 Feb 2018 08:27:07 -0800 (PST) X-Google-Smtp-Source: AH8x227i5YiyW+upWzdM07iBVRml6LgQgtk3oDBoBb1O9VKTfgZduHA9lW0yBXB7+Y2lgx+gKtjX X-Received: by 10.101.90.10 with SMTP id y10mr4203579pgs.34.1518798427216; Fri, 16 Feb 2018 08:27:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518798427; cv=none; d=google.com; s=arc-20160816; b=IkC/4aQDJX5JtCdLjfrWqsj0bYVbzAEpYTqHdrwmGjbycjFBlKzhRfwHNAA2UpBTcz onzT9pMCXljL3HjYMql+jaXfTKrzo/lMiag0i92kHH7x6idIKDusYABgUhUHPjrT1YNI E4QwPEmJJH0c4M+237xYn74vyRD/U1HnXk6pNJTYvSiFTmUYKHJohnUfrQj0sA4upAIx WtEyoH3eX4zYe8pO8bL9yH6MB1Wy6evai8TReb3MFlAox2m0mdveHKGL3JRbGe/otQqF gfER/ZlF7uVqfegPLYHH2Xt6qT1WnmRSb7BiCUsE1ecAv3I+BjXyJwGvMy7o4Qljqom2 6zxQ== 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=VlSYyks+QieYk6KGCLIkgjMcSdC2b+JcB9wA7UIDb/E=; b=JEIe2qaPnH4UMy3Le1gcWU+R94fpsdx7t/tmI9Ql99AVLZsHKMb2rtcev7qkC/cGtl LovwdzzzqbzjA49hgPeQ+coMyFpcxp3lyc2dE/2Zjw5vEwLiLWx2Cfd1oM5F3dhsNqeM ZHpOh8JCQvHuM3glGbMlyPdnEQ04jHI4RJfWQBlEqdPYDuYUTlOLR4xAtH8qRTOlXxhC /jLurgJsayNErmP5vbphmUQZaoVa2CY49gXciUg6TbvtrEAeOg0Xd7EHah5ARjdZuqFy ed3j0rRsyCBPfDnMdR37jjQOaQYUqO0Rk1SOcymPZdf8yQl+wiXbQ63rXZxOA3qAvmxq tWNA== 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 1-v6si1760743plk.504.2018.02.16.08.26.37; Fri, 16 Feb 2018 08:27:07 -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 S1033500AbeBOT3D (ORCPT + 99 others); Thu, 15 Feb 2018 14:29:03 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55198 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbeBOT3B (ORCPT ); Thu, 15 Feb 2018 14:29:01 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1FJSS9o063921 for ; Thu, 15 Feb 2018 14:29:01 -0500 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g5fxx937g-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Feb 2018 14:29:00 -0500 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Feb 2018 14:28:59 -0500 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; Thu, 15 Feb 2018 14:28:56 -0500 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 w1FJSuXa53674148; Thu, 15 Feb 2018 19:28:56 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 83C1BB2050; Thu, 15 Feb 2018 14:25:18 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.179]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 323F7B2054; Thu, 15 Feb 2018 14:25:18 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 030F616C1B64; Thu, 15 Feb 2018 11:29:14 -0800 (PST) Date: Thu, 15 Feb 2018 11:29:14 -0800 From: "Paul E. McKenney" To: Alan Stern Cc: Akira Yokosawa , linux-kernel@vger.kernel.org, mingo@kernel.org, parri.andrea@gmail.com, will.deacon@arm.com, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, Patrick Bellasi Subject: Re: Trial of conflict resolution of Alan's patch Reply-To: paulmck@linux.vnet.ibm.com References: 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-cbid: 18021519-2213-0000-0000-00000270298A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008539; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000253; SDB=6.00990208; UDB=6.00502864; IPR=6.00769556; MB=3.00019574; MTD=3.00000008; XFM=3.00000015; UTC=2018-02-15 19:28:59 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021519-2214-0000-0000-00005921B9FA Message-Id: <20180215192914.GA3617@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-15_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802150232 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 15, 2018 at 12:51:56PM -0500, Alan Stern wrote: > On Fri, 16 Feb 2018, Akira Yokosawa wrote: > > > So, I attempted to rebase the patch to current (somewhat old) master of > > https://github.com/aparri/memory-model. Why? Because the lkmm branch > > in Paul's -rcu tree doesn't have linux-kernel-hardware.cat. > > > > However, after this change, Z6.0+pooncelock+pooncelock+pombonce still > > has the result "Sometimes". I must have done something wrong in the > > conflict resolution. > > > > Note: I have almost no idea what this patch is doing. I'm just hoping > > to give a starting point of a discussion. > > Yes, that litmus test gives "Sometimes" both with and without the > patch. But consider instead this slightly changed version of that > test, in which P2 reads Z instead of writing it: > > C Z6.0-variant > > {} > > P0(int *x, int *y, spinlock_t *mylock) > { > spin_lock(mylock); > WRITE_ONCE(*x, 1); > WRITE_ONCE(*y, 1); > spin_unlock(mylock); > } > > P1(int *y, int *z, spinlock_t *mylock) > { > int r0; > > spin_lock(mylock); > r0 = READ_ONCE(*y); > WRITE_ONCE(*z, 1); > spin_unlock(mylock); > } > > P2(int *x, int *z) > { > int r1; > int r2; > > r2 = READ_ONCE(*z); > smp_mb(); > r1 = READ_ONCE(*x); > } > > exists (1:r0=1 /\ 2:r2=1 /\ 2:r1=0) > > Without the patch, this test gives "Sometimes"; with the patch it gives > "Never". That is what I thought Paul was talking about originally. > > Sorry if my misunderstanding caused too much confusion for other > people. Ah, I did indeed get confused. I have changed the "Result:" for Z6.0+pooncelock+pooncelock+pombonce.litmus back to "Never", as in the patch below (which I merged into the patch adding all the comments). I have added the above test as ISA2+pooncelock+pooncelock+pombonce.litmus, with the Result: of Sometimes with you (Alan) as author and with your Signed-off-by -- please let me know if you would prefer some other approach. Please change the Result: when sending the proposed patch. Or please let me know if you would like me to apply the forward-port that Akira sent, in which case I will add the Result: change to that patch. Or for that matter, Akira might repost his forward-port of your patch with this change. Thanx, Paul ------------------------------------------------------------------------ commit b2950420e1154131c0667f1ac58666bad3a06a69 Author: Paul E. McKenney Date: Thu Feb 15 10:35:25 2018 -0800 fixup! EXP litmus_tests: Add comments explaining tests' purposes Signed-off-by: Paul E. McKenney diff --git a/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus b/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus index fad47258a3e3..95890669859b 100644 --- a/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus +++ b/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus @@ -1,7 +1,7 @@ C Z6.0+pooncelock+pooncelock+pombonce (* - * Result: Never + * Result: Somtimes * * This example demonstrates that a pair of accesses made by different * processes each while holding a given lock will not necessarily be