Received: by 10.223.185.116 with SMTP id b49csp946327wrg; Fri, 16 Feb 2018 09:42:26 -0800 (PST) X-Google-Smtp-Source: AH8x224OaKDhWabgrFBXnMXu4f8XZl41hHGTtNdNfs6ElI9V41A5vQ1nbiUB/LgXAlWjFsqY/2dD X-Received: by 10.98.47.65 with SMTP id v62mr5133550pfv.152.1518802946316; Fri, 16 Feb 2018 09:42:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518802946; cv=none; d=google.com; s=arc-20160816; b=NsFm1ua3GALkuFSIlQEjDDwIpUNd6WEgY1iP+TEYn9Ol/8pM/1HS0qXN1W235rdWi0 VSnoA5a0xokyEkKUDSbndXWNJiNBgcdT0l6x4RM1kovlm3ckgUXY4MWzAX2RqsKUBUWX 2O4APBaujKXm9VHfSSTBPahak575Vmb3YaIjlNiwNnuIJm+drHaGskPWTAlFmgEZG9Ll 1lbcw59cd4liHX5Nj1MD6NtQzCtXK0k2DBBBflu7WPXIUYayMSupBQpHfBcn7pG35rg6 5J14M6U+bYeKj7j2twBsNeTyZBh3KTtXHKSsZDxiT1+BBRwXwEXCcV7SYCNY/mV97s1l HtCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=/tFo4gB34cezrcU+J34/GPrterdMLfbLfcVKEZ/pW8Y=; b=oT33pq9NkBqDqz01XvYye4y/STaF5lIEbGXH+ZFkh9k7CMvhce5kFju/kCdgMJUtJX cQBK+7vt7NWjQEAgZchE/2BxYAZ83kXlX8XSqDo3D4g9O+Q4+xzM2P1kezVYwUKLvar9 rbqLdnLYDM+EfwGYcKWBFOym18nr7BKCnpW+yRcPB2qAfF95RToW4E0EYFlTJdX8Pzrp aQoRzTjxTwDaAsjGiPhDtY8JPd360X4bIY54GPw1jWp6Xp5dX/DsJEotzH6/78XCG0wD Swh3IzQ2A90G/C8jsfn10I82f1WEWQeimro2tHGMaUI78laVJRKDPlpBqfVRtIHuAA72 EiXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PWtKZOif; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si2728370pgn.343.2018.02.16.09.42.11; Fri, 16 Feb 2018 09:42:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PWtKZOif; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163092AbeBOWFt (ORCPT + 99 others); Thu, 15 Feb 2018 17:05:49 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36488 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163005AbeBOWFs (ORCPT ); Thu, 15 Feb 2018 17:05:48 -0500 Received: by mail-wr0-f195.google.com with SMTP id u15so1175743wrg.3 for ; Thu, 15 Feb 2018 14:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/tFo4gB34cezrcU+J34/GPrterdMLfbLfcVKEZ/pW8Y=; b=PWtKZOifQZ+4b1u9IvV9M4ErqpmnPZjOSXkXDpPecJWB4vkHHYxJfziapcNhg3twZe OyUYhjT1AShhVkNYt6fH522lZ8dGuYHKFu8tGacq3k4vCyYKaKTWEtOmVGmxHvCmALDf fYL6HaZYyV9sPqex1C+VH0cR1+jvX9ewY/y75OfWKrGt6MkFWr8MQL5pZV810ta93ZK+ LOzmYljD9lQ2DqTFGF0ncjmdFx3LDte/TSaQLzl/gkpPeuE8yWSoPJh94rFv6FRli3aH a83ri8J4/+0nJf4NHTvcxeKl8Slfm9I20N/SMSBdpyH1mKEpdTHyeJJPO1b8NS6fbvJZ Xkdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/tFo4gB34cezrcU+J34/GPrterdMLfbLfcVKEZ/pW8Y=; b=dVVPAw4zsUi0rNTJ6tak1Yx4HcuCDy6/dZi2tRhJnF0ecAwz3w332JnfqD61zl65TU 8xCE9bOZrWDwFPsS9NrdLoBedAklkWLbarwPs9zc1oLjZHaAYFTSzV8iKoTS8eGLAGYM prhYkuZ3WNx1TqXpMRDrNpJTye6AMw3BVGj56vHQwF/rxI9PMZEK38qToXY3xSgJLtI9 8L2WL7uiehcVwqbp+0Azy505SEqh9xqhuczviPtfimO1j+h4Ynq0ZNZjf0KiVqftSIfy r9AVesGHBZRvaXgwPkr/3P0EQtuH3ItwZ/6RzifPfHbfh7fym6xR4kVut+x+bpbNFRjz lGLA== X-Gm-Message-State: APf1xPDv0rnUkQonsCLbTQAIeB6zvtz9u3GEXCp0W3HzAMdw/k7AP883 3KEU5nBpbwqxXzxh+I55O2X7ruzt X-Received: by 10.223.186.83 with SMTP id t19mr3626181wrg.252.1518732346764; Thu, 15 Feb 2018 14:05:46 -0800 (PST) Received: from andrea (dynamic-2a00-1028-8386-da8a-e035-bf19-070b-9348.ipv6.broadband.iol.cz. [2a00:1028:8386:da8a:e035:bf19:70b:9348]) by smtp.gmail.com with ESMTPSA id 10sm9615981wmj.19.2018.02.15.14.05.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 14:05:46 -0800 (PST) Date: Thu, 15 Feb 2018 23:05:39 +0100 From: Andrea Parri To: "Paul E. McKenney" 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 Message-ID: <20180215220539.GA5363@andrea> References: <20180215192914.GA3617@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180215192914.GA3617@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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: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 Andrea > * > * This example demonstrates that a pair of accesses made by different > * processes each while holding a given lock will not necessarily be >