Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp26412imm; Thu, 12 Jul 2018 13:26:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcBMGXj/CFNBK7f70NtJi0wykyE4m2TwAKFdFldNTDSBQIq1sAv+KZgITRYIUmd6wo4Tjbl X-Received: by 2002:a17:902:4101:: with SMTP id e1-v6mr3523321pld.205.1531427173770; Thu, 12 Jul 2018 13:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531427173; cv=none; d=google.com; s=arc-20160816; b=fE9HmO8mDunP2fIYSMqUBAAq/dMV+x/MD32T422MOOA9EaOj9IzPU7+vWPnc1n+3Pw 6xghZw4F3D/FdOOMHL6MVUC0KWUsGPNXQYGdmDkwAe+BurMtfNlSo0dsdsNRUCDzyJW0 y0N47rK1V4+Q0WM6zB951ezN4quVVcFlAF9ybLT047ylW+s7SMXtJwHK+BGc0UEmqozw u26kGLQNadxd2eI/XpbeabHV75/8QvLWn6IpLs1C1jdgPu37pDgeUVzq9DwRGUH+GL5O 8+y6/jce65FBom2iHHz38BGFwE/90b/ZsDPUsmMmyneubgakgAGy+X177k56rqxS9lUz Vi8g== 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=AYAl5xnAYGcJDNAhwvd4tL+Dw8xlM19tgr4bTlGbMOY=; b=FU7ltKqS3jW6Vqa8Wv170L7iplndlBt+eHWS2etrCFV6IL/+1I5qkSAFIktY6oDuGm Sif1IH2VZway07gGXBF6nZL30vcEkN/z45Khw3x2JT3Q7EGsTynCHhTxTmf++XykHBsH xIrxhRBrfh2qvSDtaJH80i27yfBM1KRK+UECKNFFOj+9T3xpBrGquH3c9QFhmnEnwoEZ FZ+FwSI3z3L8/4AVYJe38EXs5bfJpa+dYgVl5S8I66FS5D0RCTyTD0wDVlFDFogRWxgl eUDaDZ7I3dEJh4r3qs8LkU7RaLo7C9k8AT+h/Xec1b0KrtRmQK73INU8U5blQ9STIQdx WdHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MscrUBLN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34-v6si22140141pld.252.2018.07.12.13.25.57; Thu, 12 Jul 2018 13:26:13 -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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MscrUBLN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732553AbeGLUgR (ORCPT + 99 others); Thu, 12 Jul 2018 16:36:17 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41070 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732437AbeGLUgR (ORCPT ); Thu, 12 Jul 2018 16:36:17 -0400 Received: by mail-wr1-f65.google.com with SMTP id j5-v6so16414398wrr.8 for ; Thu, 12 Jul 2018 13:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AYAl5xnAYGcJDNAhwvd4tL+Dw8xlM19tgr4bTlGbMOY=; b=MscrUBLNXauxzyDx0O423PJAiUBtcbUr6o7lNnu29cRCUbI0Z1e62FNMHvb/IQKKpY ffXv9ZKUU4lcJiq3wbNzkBEZBRVq/3Sat83TvdY38NTBkgYhit3rjghioAVE4eUGSvl7 Ea1lXWF2I7zcrvHVLdK65pTjasxMeLbgJ9pgg= 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=AYAl5xnAYGcJDNAhwvd4tL+Dw8xlM19tgr4bTlGbMOY=; b=mO4qTYHGWSRlcYYTqo6+7i7skkkGMV3aFSXRgK4mUdkAG85V0ZNB9MmnhKJdXZdP/Y izJbKsz8KZwJamLiYbyR1FPmG6Jekvj3mN00lPiqjszlh+CxbMg67PgGOvo3kuVWnCUM FP1BEALoPx8tcCjZJCzWA9GSRqOlR3Twd5ztAlvcRgGnzeuPVQSNxlVhS5upa1dIIWXB /PFzcMrhxU7DB61U+ew647F7ec0zA8QUCR+9OzBAYnwshWsNyV0/uAVfPVR4tyOVB/l/ fs6xDzssb0t4SnTxHf2yIqpB+LWGnOT+BLO+Mh8Cmbdb4RfVchLpR2y4/tzxC68RtG9b Jztw== X-Gm-Message-State: AOUpUlEIT3JlHkbcr+mtSdtBnk7wJ2xnbg9p+7hMQ1chbdZ1BED4lnk/ eJRtS0DWLB0ge4cHQSEDH9XrgA== X-Received: by 2002:adf:8f2e:: with SMTP id p43-v6mr2730859wrb.193.1531427106525; Thu, 12 Jul 2018 13:25:06 -0700 (PDT) Received: from andrea ([94.230.152.15]) by smtp.gmail.com with ESMTPSA id c13-v6sm15911754wrt.24.2018.07.12.13.25.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 13:25:05 -0700 (PDT) Date: Thu, 12 Jul 2018 22:24:57 +0200 From: Andrea Parri To: Linus Torvalds Cc: Peter Zijlstra , Paul McKenney , Alan Stern , Will Deacon , Akira Yokosawa , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nick Piggin , Linux Kernel Mailing List Subject: Re: [PATCH v2] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire Message-ID: <20180712202457.GA4767@andrea> References: <20180712134821.GT2494@hirez.programming.kicks-ass.net> <20180712172838.GU3593@linux.vnet.ibm.com> <20180712180511.GP2476@hirez.programming.kicks-ass.net> <20180712195242.GA4170@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712195242.GA4170@andrea> 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, Jul 12, 2018 at 09:52:42PM +0200, Andrea Parri wrote: > On Thu, Jul 12, 2018 at 11:10:58AM -0700, Linus Torvalds wrote: > > On Thu, Jul 12, 2018 at 11:05 AM Peter Zijlstra wrote: > > > > > > The locking pattern is fairly simple and shows where RCpc comes apart > > > from expectation real nice. > > > > So who does RCpc right now for the unlock-lock sequence? Somebody > > mentioned powerpc. Anybody else? > > powerpc have RCtso (and RCpc) but not RCsc unlock-lock, according to the > following indeed original terminology: > > - RCsc unlock-lock MUST ORDER: > > a) the WRITE and the READ below: > > WRITE x=1 > UNLOCK s > LOCK s > READ y > > as in a store-buffering test; > > b) the two WRITEs below: > > WRITE x=1 > UNLOCK s > LOCK s > WRITE y=1 > > as in a message-passing test; > > c) the two READs below: > > READ x > UNLOCK s > LOCK s > READ y > > as in a message-passing test; > > d) the READ and the WRITE below: > > READ x > UNLOCK s > LOCK s > WRITE y > > as in a load-buffering test; > > - RCtso unlock-lock MUST ORDER b), c), d) above. > > - RCpc unlock-lock MUST ORDER none of the above. > > AFAICT, all arch _in_ the current implementation have RCtso unlock-lock. > > > > > > How nasty would be be to make powerpc conform? I will always advocate > > tighter locking and ordering rules over looser ones.. > > A simple answer is right above (place a sync somewhere in the sequence); > for benchmark results, I must defer... Sorry, not sure why but I did intend "conform to RCsc" here. > > Andrea > > > > > > Linus