Received: by 10.223.185.116 with SMTP id b49csp811136wrg; Fri, 16 Feb 2018 07:34:01 -0800 (PST) X-Google-Smtp-Source: AH8x225lqF0KEF6RujEN85kcWPvJBi9zsigv0yMh3Wz16fTOpt7WjPuSygRHZAE0OQHSMf/BAwIz X-Received: by 2002:a17:902:4523:: with SMTP id m32-v6mr6212312pld.449.1518795241731; Fri, 16 Feb 2018 07:34:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518795241; cv=none; d=google.com; s=arc-20160816; b=mbpc6t4HiHzVPS/NWIJj1pUuWwLfopVFxNRcZ4iC3oXknaATDUOW7wyXFu71iVx3bi eZBdN8CjAIrFUla9qTqgjoRNN2qzKHsA3WtaGKzk6i5b95q1fv8chm6vOpM9L2gVKIGi jD5T2Dt/i295G7PJNli1MonJnT91Ci36wUCVu31EGJJaJHdP6HNVMijJcHBYl5WOpgI0 x7uVQLQnQpLugw3WZl6nS6eSMp9i/orq7KtlGzyE8BYgpPxebYhfPKDu5szHmfGG+2Zq e/kMlFRqfLz6x/wnAHVnlE6+jMv59yUNTv7GG2LeSRBERn0cwWm0dNMIwt/9+AEGumS7 7Z9g== 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=oEhiU8g3hefFUzpSw9yOn6Y+qTLT0hU+mRYObfmZ6Vo=; b=yaImCiP5VwpYaEyGI1Qu/6WNDcIOVpYz6kSqhTJFAYtIWSIY4yLCUfDEv/b8PX6SfZ Ft3qCY723qHOJJp/ovkVORVTDFi8ufinZhgN7XgC9DEJPnnhDvMBzvg1cRwlYgqqSD9c UVY4YMOB9HJ9njop8xuU9qyvoxDkzM9G7lJSdX6cqDhoYemZap/zWX6Vd4vWHzl2Aoe4 Gyz53IdxFQqOwbh1qltLbsEUlfx8/r8n8yBzWj4agXxRDStBUAHVclFx8XDQztiaCAHz EOsRyLH5H8lvBrAqiMoKxAj6mrynqCNuow+EELwqAEWZMP6EUeNWpKHQoGLXzfYs1ZM7 Ey3A== 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 30-v6si1619737pld.181.2018.02.16.07.33.45; Fri, 16 Feb 2018 07:34:01 -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 S1756309AbeBOWl3 (ORCPT + 99 others); Thu, 15 Feb 2018 17:41:29 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34204 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756294AbeBOWl2 (ORCPT ); Thu, 15 Feb 2018 17:41:28 -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 w1FMdESv119966 for ; Thu, 15 Feb 2018 17:41:27 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g5fxxf6ek-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Feb 2018 17:41:23 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Feb 2018 17:41:21 -0500 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Feb 2018 17:41:17 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1FMfGMa40763508; Thu, 15 Feb 2018 22:41:16 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3256B2046; Thu, 15 Feb 2018 17:37:38 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.179]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 8F151B204E; Thu, 15 Feb 2018 17:37:38 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 871C116C1B63; Thu, 15 Feb 2018 14:41:35 -0800 (PST) Date: Thu, 15 Feb 2018 14:41:35 -0800 From: "Paul E. McKenney" To: Andrea Parri Cc: Alan Stern , Akira Yokosawa , linux-kernel@vger.kernel.org, mingo@kernel.org, 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: <20180215192914.GA3617@linux.vnet.ibm.com> <20180215220539.GA5363@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180215220539.GA5363@andrea> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18021522-0048-0000-0000-0000023A3AF8 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.00990272; UDB=6.00502901; IPR=6.00769620; MB=3.00019576; MTD=3.00000008; XFM=3.00000015; UTC=2018-02-15 22:41:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021522-0049-0000-0000-000044261561 Message-Id: <20180215224135.GC3617@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-15_10:,, 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-1802150272 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 11:05:39PM +0100, Andrea Parri wrote: > On Thu, Feb 15, 2018 at 11:29:14AM -0800, Paul E. McKenney wrote: > > 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 > > nit: s/Somtimes/Sometimes Good catch, fixed! Thanx, Paul > Andrea > > > > * > > * This example demonstrates that a pair of accesses made by different > > * processes each while holding a given lock will not necessarily be > > >