Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1828008imm; Fri, 6 Jul 2018 07:14:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeQzO1PXRmQ7YIKMUzOUYWz6vGLf71Fe2lZpgtQVV71DtIZw3iIuCmlFmD9jDuZy+kKLwQr X-Received: by 2002:a65:608b:: with SMTP id t11-v6mr9558953pgu.259.1530886463146; Fri, 06 Jul 2018 07:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530886463; cv=none; d=google.com; s=arc-20160816; b=kgeVYuUj0oZ8XyYtetaKBZnBBd/OEWWbvgXz/Dx0mynF0nChCMGxWpRTUcG1ths7hf w2/I0AwAvmDUGsrCHShEQKYhsqjftl3CggSAYyIKIPBm7UZ9JjYJneFNXrloW+tGeS5K ow4ecwMF6vA/IYC5XhJbYeNmnUgdbyR8Mxsa3+KkyT4YBJA9ZyvknNM6hQNWF6OkWE59 jaMYvE+eUlEDqnfg+Tpy6kyyTRf/PNB8ui/oD394O9sQ8gPWf2pCvh7PXVpucE5moc5f DU3kxMBqo3Z+iLIxFRTiWk5+rtpBM4PfLKyp8nl0z2K7OJJMn7IezpYI1CFtojCDXmfj RvGA== 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=nlspZKsfJ7+akhQwpHi47vG2ZELs5jqAPkFUwywECc8=; b=0myYA6eLHH0IVaJNZalqOQimT1hDF4AOTp+14FFKlQriUYf2wFI3Vp6joWueIQc76Z m2MoTHuqLkAkIIefQE9z0FOzGL8TRwa/v9AHTNILfwlRCyBc0pWSBBt/6d6y5BpoOPW+ TLFaDyQF+Rn0juzI1FKjiVo+yFnsL+uq/MOj/Pwp5KqDMPS4Woq1JuXaX9YuaN2TCA9R Cs16QB0u2B+RUK06PaZyzUM0zMHXPie7y04KkzAYNaLJsoC04kbiPp/G8uhpcLLtVfQC qpFuMspVXxf/1KsRgYl6f1xsbLsCdECc5d2dj5vhf4yG/VBHqrovNVfRWYRhilvW4pgD VBxw== 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 f27-v6si8118415pgb.302.2018.07.06.07.13.52; Fri, 06 Jul 2018 07:14:23 -0700 (PDT) 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 S932769AbeGFOMk (ORCPT + 99 others); Fri, 6 Jul 2018 10:12:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41318 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932562AbeGFOMg (ORCPT ); Fri, 6 Jul 2018 10:12:36 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w66E8Zg6088304 for ; Fri, 6 Jul 2018 10:12:35 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k286dd21e-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Jul 2018 10:12:35 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jul 2018 10:12:34 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 6 Jul 2018 10:12:30 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w66ECTmf13238752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 6 Jul 2018 14:12:29 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71D0DB205F; Fri, 6 Jul 2018 10:12:09 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 52C0EB206A; Fri, 6 Jul 2018 10:12:09 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 6 Jul 2018 10:12:09 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 7007316CA5CF; Fri, 6 Jul 2018 07:14:45 -0700 (PDT) Date: Fri, 6 Jul 2018 07:14:45 -0700 From: "Paul E. McKenney" To: Will Deacon Cc: Daniel Lustig , Alan Stern , Andrea Parri , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Kernel development list Subject: Re: [PATCH 2/2] tools/memory-model: Add write ordering by release-acquire and by locks Reply-To: paulmck@linux.vnet.ibm.com References: <20180704121103.GB26941@arm.com> <20180705153140.GO3593@linux.vnet.ibm.com> <20180705162225.GH14470@arm.com> <20180705165602.GQ3593@linux.vnet.ibm.com> <20180706092529.GB17733@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180706092529.GB17733@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18070614-0072-0000-0000-0000037B1A1D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009319; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01057410; UDB=6.00542513; IPR=6.00835330; MB=3.00022025; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-06 14:12:33 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070614-0073-0000-0000-0000489D3D0C Message-Id: <20180706141445.GC3593@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-06_04:,, 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807060156 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 06, 2018 at 10:25:29AM +0100, Will Deacon wrote: > On Thu, Jul 05, 2018 at 09:56:02AM -0700, Paul E. McKenney wrote: > > On Thu, Jul 05, 2018 at 05:22:26PM +0100, Will Deacon wrote: > > > On Thu, Jul 05, 2018 at 08:44:39AM -0700, Daniel Lustig wrote: > > > > On 7/5/2018 8:31 AM, Paul E. McKenney wrote: > > > > > On Thu, Jul 05, 2018 at 10:21:36AM -0400, Alan Stern wrote: > > > > >> At any rate, it looks like instead of strengthening the relation, I > > > > >> should write a patch that removes it entirely. I also will add new, > > > > >> stronger relations for use with locking, essentially making spin_lock > > > > >> and spin_unlock be RCsc. > > > > > > > > > > Only in the presence of smp_mb__after_unlock_lock() or > > > > > smp_mb__after_spinlock(), correct? Or am I confused about RCsc? > > > > > > > > > > Thanx, Paul > > > > > > > > > > > > > In terms of naming...is what you're asking for really RCsc? To me, > > > > that would imply that even stores in the first critical section would > > > > need to be ordered before loads in the second critical section. > > > > Meaning that even x86 would need an mfence in either lock() or unlock()? > > > > > > I think a LOCK operation always implies an atomic RmW, which will give > > > full ordering guarantees on x86. I know there have been interesting issues > > > involving I/O accesses in the past, but I think that's still out of scope > > > for the memory model. > > > > > > Peter will know. > > > > Agreed, x86 locked operations imply full fences, so x86 will order the > > accesses in consecutive critical sections with respect to an observer > > not holding the lock, even stores in earlier critical sections against > > loads in later critical sections. We have been discussing tightening > > LKMM to make an unlock-lock pair order everything except earlier stores > > vs. later loads. (Of course, if everyone holds the lock, they will see > > full ordering against both earlier and later critical sections.) > > > > Or are you pushing for something stronger? > > I (and I think Peter) would like something stronger, but we can't have > nice things ;) There is a lot of that going around! ;-) > Anyhow, that's not really related to this patch series, so sorry for > mis-speaking and thanks to everybody who piled on with corrections! I got > a bit arm-centric for a moment. I think Alan got the gist of it, so I'll > wait to see what he posts. Sounds good! Thanx, Paul