Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2077640imm; Thu, 12 Jul 2018 12:54:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdsVERDM7CtCLo46CuwAaNIA/q+dAYpdgW1WeeTVwll1Yuxje6J2o08biUaJgRgY/KUTk56 X-Received: by 2002:a65:4545:: with SMTP id x5-v6mr3317199pgr.4.1531425242908; Thu, 12 Jul 2018 12:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531425242; cv=none; d=google.com; s=arc-20160816; b=BPfMcI+s2gBzGpsBs3fBn4ysx2/M3eUeaoFUHhyaA+XvKalLDIovObmXb6BMTJwaGr tQRX/rWde4kDzs5USgE7mUrXILuOOOGDqWDRwOfHc693OE7DjdkmTJe2hRbvqNjq60FQ DNeCLQRXZ5n0llXOjTUiAJC8WMXqMVUaTPrbynguc1knVBxArlkVKP1p1CWJnSiy+Ztg qVpytQkUo8qRogRVIJWLLMlC6HRBwwe4UOswyElhOU+lp2tOq4I0BZuZ8YCzwa6LC47k Nz6jD1wE88RiZ+bCaFFYHwhqRvvN+hUcwlWl8tWUrsQtwoshreoElgEzKzxjAT+03gS5 98TQ== 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=2NChlkRFqlHNcvXB2DgHuwLzXuFBRT3gcaEXutBFnTE=; b=uNTQ2T8EQg1rqg1XGQeulnRjQXfKCzIR0cmrzOb8o3QOCQYghJNa49IkiJ4o+6jqLF AiGVutEWn3hqkN8VPcRYQHlFadBU8ryJ/sZYF46/NmyrNab+AeFLWitg9WJKFEN/bvr7 uTndNdqwMPW3fh7dy1cN6XMZHkZ+7SiwWW0NEXPQbSBfL4BvUsI10m9AVAPhQsNRY6au t8yPYU9ebKG5ndz3gGa1AczKr38END8w6mVUObUyoD52RrTK6LXM9z9DuPHT+L3j4xc7 sdvmr8R8yT6zH9renraMW32cE7wl9I/t1XVCMay6JGVrXIHtU/Q7ThCoZYFzLXOToCe0 2uxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mWHvmBV0; 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 d31-v6si22336298pla.190.2018.07.12.12.53.39; Thu, 12 Jul 2018 12:54:02 -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=mWHvmBV0; 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 S1732383AbeGLUDx (ORCPT + 99 others); Thu, 12 Jul 2018 16:03:53 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41883 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732217AbeGLUDw (ORCPT ); Thu, 12 Jul 2018 16:03:52 -0400 Received: by mail-wr1-f67.google.com with SMTP id j5-v6so16337151wrr.8 for ; Thu, 12 Jul 2018 12:52:49 -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=2NChlkRFqlHNcvXB2DgHuwLzXuFBRT3gcaEXutBFnTE=; b=mWHvmBV0b1OYD+f6VEwwTk6YuPhenAtSXiO/KY5/ZKBKfiAeVqneh/6Fs2/Qh/Egs8 X9lcfbBHTn2wLru7VyvJnVWA+qoxC0foHt9uHtGj+z1mfte32K8ZO2NOqy3GmvpbOr21 uwIx+j4nyErTgAerK2zqg4X0aSLp4jpjH9Q6w= 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=2NChlkRFqlHNcvXB2DgHuwLzXuFBRT3gcaEXutBFnTE=; b=HJgk3xvE8rT5UB7P0ihKDklJhrizwmw+uVhM3heZVrF9D+wm7BHWLXbNNAtB80O4WZ /Gseo/MnNnsaw8GHk+l/f/U5NPGi/RU9EEr5p3Lst7ZSZ52NsqehRfcjq823Bxp6IYOA sIkogU/ghWz0oskaebg1sDWpvqAL4jQrntwuX7s25fJRKe9gjE5aUef3fiIo/HPQz4iM A9N6SGF2vlV8j0HgdbGwkqJUDUWt//gYpal/OF9xSrksAPXuhyFrfLDmCpj7x3GlhdtC tRVNP/1GHbW1i8CWygHFZJS3sIDrwTATWp/1vBNGEg/CDjNR/wQEFqxiHcaqcHUNfkLr QCEQ== X-Gm-Message-State: AOUpUlEbvxet2LPojpJH+MOH437dyJ7f1mAWNHCRHkeLkcvG5BxI8awd CVmcDOBkHPJlgU1/7fTMbz+9SQ== X-Received: by 2002:adf:8b01:: with SMTP id n1-v6mr2876648wra.282.1531425169048; Thu, 12 Jul 2018 12:52:49 -0700 (PDT) Received: from andrea ([94.230.152.15]) by smtp.gmail.com with ESMTPSA id i9-v6sm18486053wrs.92.2018.07.12.12.52.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 12:52:48 -0700 (PDT) Date: Thu, 12 Jul 2018 21:52:42 +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: <20180712195242.GA4170@andrea> References: <20180712134821.GT2494@hirez.programming.kicks-ass.net> <20180712172838.GU3593@linux.vnet.ibm.com> <20180712180511.GP2476@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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... Andrea > > Linus