Received: by 10.223.176.5 with SMTP id f5csp2769674wra; Thu, 1 Feb 2018 05:54:23 -0800 (PST) X-Google-Smtp-Source: AH8x227R+zbtplNAn/h5iICgfDrVbbrquLWJAZ04chhz5PvMfnCAKPPyO/JLXWoRU1nWdFJbK7tC X-Received: by 2002:a17:902:e83:: with SMTP id 3-v6mr26106977plx.274.1517493262913; Thu, 01 Feb 2018 05:54:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517493262; cv=none; d=google.com; s=arc-20160816; b=P8k0YPg45NzCNuCPQBrKUJqxqG6aYll5RsRCFOOYT/wVkLw+R7qsBR+VmOHq4kZ7rD 0xYiduHXGPc99fEyEsJjT+PEeyR9F5k//7hyhk4gE35Ndx+PhaKrDmNni/MOwxswvpn3 ft+UA1K2bmNyW9pQSjvjoBquWXsZ9Q/TR4kMKMkH1sbV3/KSj5LsrCu+FIHQj+DOevqR ax3Zsur8SEhP3b/kyavWFZlQidQ0b/YIX6EAg9CxSNX/Le3mjyls0ozJaCtwGPWhEMh5 6m25sxdnFf4jYafbvCtDDSLxDjUZHE9K5ja4+FsAgqbxJLEMV9LES0nK/iVW/U5UK8wO i+Qw== 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=hH1ANUa7biG+fICK7zTRzjDPDQYTANCda9RXCIlKI4I=; b=kPKbk7iLd+f3ZwJpxOENfcyyOSuan1XA6oYHitGg4QNgmnAALv/m1psug2ToIx1L0w 1MVnPictTb8E2kIeNf2ZyWm68uhEunJGwzvgQbV/ktBo2k2PcqDplriW0nZCWcLO+/8Q I9aC5NniwT36Y2rs2nIYD+IWwrCzz9844LdN5ViN1yKvSMCzHat0OZcva4gET321TPPy IMutXbr9dk7dKtnLSiryOgc1CODcmhw3oUpskXivkaJzMZMzH5HsAzp4KMug7oOfzl9N snT4IFOAjIY7ap8GgYndWgNJotT6mi8pwMm9uGOcDnwSP7/g9mXfqpl7SKnqy/1+5I9x 0P0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oo8Q0RcP; 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 i135si1606087pgc.459.2018.02.01.05.54.07; Thu, 01 Feb 2018 05:54:22 -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=oo8Q0RcP; 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 S1751464AbeBANxn (ORCPT + 99 others); Thu, 1 Feb 2018 08:53:43 -0500 Received: from merlin.infradead.org ([205.233.59.134]:54750 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750988AbeBANxm (ORCPT ); Thu, 1 Feb 2018 08:53: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=hH1ANUa7biG+fICK7zTRzjDPDQYTANCda9RXCIlKI4I=; b=oo8Q0RcPKlFsVE6JWLHOcbgTs TnDNrUeiOdgBFQL6g2szZKF/n4ayi2YBXTrCe1niLR4M9P9Wfhxkg7dDbnMouRHa8w7rzJvK9fSDI NzVA9nJ7c/whj8NtEb1d1xYxuGPjUa04iOTXErrLg93YaP8EXx+mHbJisiIZLlbGopsfKMEOM6+ky AJpQ62CfFiU5oD7j3ZCEmdgoIQQ1QP+YPa6q/J1G9Nb2+pH7Dj+uImbJj6AmUlKgQPCgjBrj/sQDN w1U04WcLzDrP4SzkeFsSB1gWsT6htH10zSbV3wn3ukF7TSMjr1e5B0K4uajRjebAcCxtAi02mvrOF NABX88BAw==; 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 1ehFIw-0006bP-MJ; Thu, 01 Feb 2018 13:53:31 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6475B2029F9F9; Thu, 1 Feb 2018 14:53:29 +0100 (CET) Date: Thu, 1 Feb 2018 14:53:29 +0100 From: Peter Zijlstra To: Will Deacon Cc: Stafford Horne , Paul McKenney , Jonas Bonn , Stefan Kristiansson , David Howells , Arnd Bergmann , linux-kernel@vger.kernel.org, Thomas Gleixner Subject: Re: asm-generic: Disallow no-op mb() for SMP systems Message-ID: <20180201135329.GB2269@hirez.programming.kicks-ass.net> References: <20180131130034.GR2269@hirez.programming.kicks-ass.net> <20180131131737.GA5097@arm.com> <20180131132610.GT2269@hirez.programming.kicks-ass.net> <20180201122750.GE30895@lianli.shorne-pla.net> <20180201132909.GW2249@hirez.programming.kicks-ass.net> <20180201133229.GB9182@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180201133229.GB9182@arm.com> 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 01, 2018 at 01:32:30PM +0000, Will Deacon wrote: > On Thu, Feb 01, 2018 at 02:29:09PM +0100, Peter Zijlstra wrote: > > On Thu, Feb 01, 2018 at 09:27:50PM +0900, Stafford Horne wrote: > > > I tried to clarify some of this in the spec v1.2 [0] which help formalize some of > > > the techniques we used for the SMP implementation. Its probably not perfect, > > > but I added a section "10. Multicore support" and tried to clarify some things > > > in section 7 on Atomicity. But it seems I dont cover exactly what are are > > > mentioning here. In general: > > > > > > 1 Secondary cores have memory snooping enabled meaning that any write to a > > > cached address will cause the cache line to be invalidated. > > > 2 l.swa (store atomic word) implies a store buffer flush. > > > > What about l.lwa? Can that observe 'old' values, or rather, miss values > > stuck in a remote store buffer? > > > > This will then cause the first l.swa to fail, which, per the above, > > would then sync things up? Which means you get that one extra > > merry-go-round. > > That's ok from a correctness perspective, though, as long as store buffers > are guaranteed to drain. Depends a bit if you can build control dependencies off of l.swa succeding or not I think :-) Otherwise you get into that dodgy state you suffer from where bits can leak right through. That is, I was thinking what we need for smp_mb__before_atomic. I could've gotten my brain in a twist or course, which isn't _that_ unusual. I never seem to be able to quite remember the holes you have with ll/sc on arm64 :-)