Received: by 10.223.185.116 with SMTP id b49csp1746613wrg; Thu, 22 Feb 2018 02:23:18 -0800 (PST) X-Google-Smtp-Source: AH8x227t9qptSrp1VxsK0DEVBoZPsysGBk6PbZnMVufnYV6VOPRX57lAFLmjUXjlNn0rHJ+fz2FR X-Received: by 2002:a17:902:8a89:: with SMTP id p9-v6mr6046275plo.397.1519294998728; Thu, 22 Feb 2018 02:23:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519294998; cv=none; d=google.com; s=arc-20160816; b=F+PZyuLfAhgh4wLsU8c2QdDwcz4veUQQgZSA7oZo3x+Ull5tZN3yw90qLiQnuFbn/S gUWdakec95cGlW9DS03WFhfEroHz7uuuibPa/FIYWlVw8700vRgYaEaaM0v8XCu/0L49 9KbR0Ol5gFPczhhlL+3mSS6FTOfa06BdHDvWyFETZX+vHvBUe0Fv1HcyR59L6BtF00Rs SLqAOPSKA1sx9LbEz+zph8mXqMZLMMsMiU2QpjpYK0RT+V7SxpkLYdXZ6i2T2YKgllSM NwFJe/yI4hlL7NLflEOlBMMfv7s2V5+GpLW2/r/ks4Anmr0/PZSGYAH+aJ+4xVPa7pie 8Nuw== 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=xMILCMDsvoPd5ywkKZC6h1kUjY0u8jJwQGXf7qjJLh0=; b=XHGH2kOygDJc0npyiqsKqgpNYyxmFCrv+/iT6oBnB97eBSTMVWXN+WQzlZm4Jw7ciV TQ4YKgoHNVIF2Fc83rvGTyKdFfvoiuOBz8fBLmLPGJ4XMWFrp3KtuE8bb6OPVPprKf3Z xBZYPSk+NBK3lACOf2lb6bAZ0vPQlqvXrJOxbUfstitcecuLoIOZwG6pN+qKdMFeQqqh wsj6RND+OQ2USX1Mfs7FOcN4D3fqXolIdz3fJDh0kJTgHzLRhCfv+zLo0XSGQvQ0IJnQ nF7jK6YfEdJfYVO+v7Potwhw3NSBPi1eRrUMRHAKAKQ+B3S0TRz3nvRLCuBMCW6WNzE4 zPxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=GBJnOOiu; 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 91-v6si2849538ply.413.2018.02.22.02.23.04; Thu, 22 Feb 2018 02:23:18 -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=GBJnOOiu; 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 S1753431AbeBVKUo (ORCPT + 99 others); Thu, 22 Feb 2018 05:20:44 -0500 Received: from merlin.infradead.org ([205.233.59.134]:49438 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753386AbeBVKUm (ORCPT ); Thu, 22 Feb 2018 05:20:42 -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=xMILCMDsvoPd5ywkKZC6h1kUjY0u8jJwQGXf7qjJLh0=; b=GBJnOOiuK5jKHnuwQ9RVSLA/9 tdxhDWb40oI4xsfsCKmjbXmvj2nV3F2ugnRHPYguWApHvPq58+SWiPteBQfaHvkLVmtoSoj9tmC6u 2UgicVmPSZg8yb+aNPiVoe+NjWeDoIC2T7RwR8ljaxqyYuX7h6b0wK9ohXfgzfhMFHsOEBhqjWG3Y 2PepTUCcv0xDXrKshoPF6mbscCZJrJ3xRwoB1w0I4PRS8ebw1cFj27ba/3Bh3Mc+hn/bKvEAgDTGn I3S4xWsb1QnbRKFc2gviQlLwLArn++T4TLPL8XqwMJjzVlJcF9pI5lzOyVFrVur4Y5xMvHb3T5EuU otQOf3/vQ==; 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 1eonzH-0003Mm-AP; Thu, 22 Feb 2018 10:20:27 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 26514202A062D; Thu, 22 Feb 2018 11:20:26 +0100 (CET) Date: Thu, 22 Feb 2018 11:20:26 +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: <20180222102026.GT25235@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> <20180222100636.GP25201@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222100636.GP25201@hirez.programming.kicks-ass.net> 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 Thu, Feb 22, 2018 at 11:06:36AM +0100, Peter Zijlstra wrote: > 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. > Or are we talking about a third party observing while not partaking in the lock-chain? Then I agree, the stores can be observed out of order by this 3rd actor.