Received: by 10.223.185.116 with SMTP id b49csp1734648wrg; Thu, 22 Feb 2018 02:09:44 -0800 (PST) X-Google-Smtp-Source: AH8x225uQaLMDJsQ/CadKtzo+c22SZu4ms3ie/JtKlJzrVAzLyLwqv2HM+jF74UkjOgd3S3JhOxy X-Received: by 10.98.155.93 with SMTP id r90mr6440905pfd.132.1519294184061; Thu, 22 Feb 2018 02:09:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519294184; cv=none; d=google.com; s=arc-20160816; b=c8/SYamGJKTIS2w8hbOs820AGguagtXVbkzXgXDaSBXrHvqgAmtUe8B1o/nwGTc885 5fk7hjodkQ4vTXJXvl03oCCMV7yW0t0SbaPpOYM7pQEkHBGR96kmm9As6fBEr+131s5o pGu7rHIFWsd/LQq5wEV31L3K4/K8ad8YhNGYne9DWiggRlXqdcNPsFXXQYye/W97curv HM9B+jVAY7CXqTGv91k/vkhNScXZxPuf/AKpLyZKFvT/5SbTIl1Ol8B3eqaQ9BvMXz+p axsEDHNMkbpz3TFa/Tw6IbiZglbagyG4wtihZgVwmiTLXQsw4O28wggahabUy3yF7Wbk ahVQ== 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=29TFU9XbgSShGLX3B2ug9Wv87BnThe8q3kgScrq8SHQ=; b=ATxWmS0/fm43i8X6h2hAKpg494cvePR/rDvP7egkt1V65pqWXll1ERLULw25yM4FMO 9aI6LTTLbMxgjkJQQoZkCexVPXiFzBpWHc51DzpoYtMrHrGTQGqGzSuFu/df9F2gx4Xt 2ql/HB4AisDk0Sx1aZr0LRypQwblcx6rKRZf6Z5Oa2zbo9vca+P32kJ6LkIMnlNqr6JO OywSYefRekfzer/mKA8Pxxn4fPbd2gyI/pbhKamimWconewQ3ytEFPwK1baSQoa4y7Ea gN5w3QcJpZnON3winYds5AdwHc77fB+7PtRqFyrF7gXnFJm7ef1pncuasH/YGrqB33PZ ouuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=KqNkBDvp; 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 e6si2709913pgt.621.2018.02.22.02.09.30; Thu, 22 Feb 2018 02:09:44 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=KqNkBDvp; 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 S1753291AbeBVKHG (ORCPT + 99 others); Thu, 22 Feb 2018 05:07:06 -0500 Received: from merlin.infradead.org ([205.233.59.134]:49134 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbeBVKHD (ORCPT ); Thu, 22 Feb 2018 05:07:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=29TFU9XbgSShGLX3B2ug9Wv87BnThe8q3kgScrq8SHQ=; b=KqNkBDvp7p2TepPynAyT8SUHK gmyeXJWKUa726AuNzrBklNZyMvNM9EU9TTEfEuPIVZVeHU4Uq1bjyhjjwv5E+OJGzVJ2gw20byEf+ PD17H50b/3GqujcBrhxqk8rDjeoflYyIgZz6MOHfRG0W5tJExr/1F0waL0MHuNlF22kDM6a+SwNOn x6kv6C2nhwVJNOfo7BMyDmeTGiTI2S/e54uxMJSdsd//B6zQ5z05v3jW94eXO6O3n0xQ9cs6T8i6/ rmcc8Pigds7KDLjktQejD1KjoNfe6GTm/akSP4n4Eu3a9hPWAzRkg4sKjzFieIzmT8MI+vohqhr0D VIpV4R4jg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eonlt-0003HJ-SQ; Thu, 22 Feb 2018 10:06:38 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 653672029F9FA; Thu, 22 Feb 2018 11:06:36 +0100 (CET) Date: Thu, 22 Feb 2018 11:06:36 +0100 From: Peter Zijlstra To: Daniel Lustig Cc: Boqun Feng , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mingo@kernel.org, stern@rowland.harvard.edu, parri.andrea@gmail.com, will.deacon@arm.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, nborisov@suse.com, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: Re: [PATCH RFC tools/lkmm 10/12] tools/memory-model: Add a S lock-based external-view litmus test Message-ID: <20180222100636.GP25201@hirez.programming.kicks-ass.net> References: <20180220232405.GA19274@linux.vnet.ibm.com> <1519169112-20593-10-git-send-email-paulmck@linux.vnet.ibm.com> <20180222032349.klcuiq23f52sfop6@tardis> <20180222041357.GB2855@linux.vnet.ibm.com> <20180222052746.vofmqbpnmfahck3z@tardis> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 21, 2018 at 09:42:08PM -0800, Daniel Lustig wrote: > And yes, if we go with a purely RCpc interpretation of acquire and > release, then I don't believe the writes in the previous critical > section would be ordered with the writes in the subsequent critical > section. Excuse my ignorance (also jumping in the middle of things), but how can this be? spin_unlock() is a store-release, this means the write to the lock word must happen after any stores inside the critical section. spin_lock() is a load-acquire + test-and-set-ctrl-dep, we'll only proceed with the critical section if we observe the lock 'unlocked', which also means we must observe the stores prior to the unlock. And both the ctrl-dep and the ACQUIRE ensure future stores cannot happen before. So while the lock store and subsequent critical section stores are unordered, I don't see how it would be possible to not be ordered against stores from a previous critical section.