Received: by 10.223.176.5 with SMTP id f5csp2745160wra; Thu, 1 Feb 2018 05:30:22 -0800 (PST) X-Google-Smtp-Source: AH8x226LZor3Pzx/P3Xlws+R1s1ppYrBGJ9Qj1od2GxDuNk7M+qjXkaAsPfc4Pkv82cHsYFODzNa X-Received: by 10.101.80.130 with SMTP id r2mr28603851pgp.107.1517491822372; Thu, 01 Feb 2018 05:30:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517491822; cv=none; d=google.com; s=arc-20160816; b=YxrUiQn6pBuG5gF7b7JcbQUKzxI/PGxzb33+PgqVddcMa3Evm7OKmiKTwPitt9vEXr iLkNkrEb5+iSOTKRMVgqqg0+tVleNcTocTXaMDM0T+fzhxmNF+Azvgsz6/hli4LfLagS evYkNbspUIcd7HOQ326NgyS89kMIbrhc/E4Bk9hjKibh/GNNf8r3eiKvlY9oLWizu6SD cZL5JgW8eGMf0bFoQWdvy1KRmvvUVRp10Xmijnq47Inp8AW22u9hn8v5eTMpn2Eal7D9 Yhy7u1zWa6JwBvvviC3HSf6jIw0QBK57leHm+VBCeY3Cn/4C0GEFl9QoKrGIWqHB8rmY Fzlg== 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=ptvWhbDkEw1hvQUcfwGLTgQheFH+wYHXFPnqZqsXGCI=; b=epWMscAfkkpL+mq1g5rvjnvENoUMw39ATA+Gi4nlQbnWNWjELABrm+fMHprH1agHB8 7Y2rQDN8PycfFZ+nS1+5bkbjPeOYeqJ6t3B3hq6fhxEEMNZQiRiezLPQeeK0zDKfVWVz ibpXiGUPaa6+n2omI9cVoZBVNvkEAt20Ze+9VsQ6rGWZIi8MZO0SQr+rdPqZIHp6I+C3 CcI+CdPkEDD13KVkPp2paHDluhy1/0jdFbSPfVUhaFRdmIcZt0P+wv2dESd5IfoiVgaf 9XY8hJJJbsVWnTH+w2YXW3vS/FCEYdz++VTUr1F7mkLigW4dEJo2Amimaz4jYYPaK5mT 35IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=y6MUZQzf; 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 k24-v6si6117344pll.695.2018.02.01.05.30.06; Thu, 01 Feb 2018 05:30: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=y6MUZQzf; 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 S1752795AbeBAN3m (ORCPT + 99 others); Thu, 1 Feb 2018 08:29:42 -0500 Received: from merlin.infradead.org ([205.233.59.134]:54572 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467AbeBAN3l (ORCPT ); Thu, 1 Feb 2018 08:29:41 -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=ptvWhbDkEw1hvQUcfwGLTgQheFH+wYHXFPnqZqsXGCI=; b=y6MUZQzfWMelvkAajEm3CSUWE 9CRMzFf8mRr+1uQjtlqRE1ZlDUYt2h16ZZNnDu+2k4TjJ022r75zc6vwhwozKWr2F02ZO1qetUWCK c48x9tae/fcyvvwpqQm3AEyN+QyoKV471K6ZROVcN57/jQNOdgpduiPXV/noIbeeE2rVDi6lIbtZ2 iiu60zBM+Aaw2yEt/2R7HpVoR2CqzlKcdynshhA0x21gOUOyk8aQ8tGbdib9+fdZY80JlhMbZSb46 s/K7pyYZXpKor6feZYJoyEk0dScmq3KXiZe+Yew/n862o3gN68Aj7eFFZq1SWJJUuxE5jnuSGM9ln aCEqlYJLQ==; 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 1ehEvQ-0006YF-9i; Thu, 01 Feb 2018 13:29:12 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 277492029F9F9; Thu, 1 Feb 2018 14:29:09 +0100 (CET) Date: Thu, 1 Feb 2018 14:29:09 +0100 From: Peter Zijlstra To: Stafford Horne Cc: Will Deacon , 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: <20180201132909.GW2249@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180201122750.GE30895@lianli.shorne-pla.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 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. > 3 l.msync is used to flush the store buffer > > Also, during the IPI controller review [1] Marc Z asked many similar questions. > I believe he was ok in the end. > > Anyway, > Thanks for thanks for spotting the issue here. For some reason I remember we > did have an l.msync for our mb(). Let me think about and test out this patch > (and the fix to actually define mb) to see if anything comes up. > > Also, I haven't seen any implementations that use WOM. Stefan might know better. So if the strong model has a store buffer, as I think the above says, then it is _NOT_ correct for l.msync to be treated as a NOP, it _must_ flush the store buffer. At which point I think your 'strong' model is basically TSO. So it would be very good to get that spelled out somewhere.