From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754693AbbCQQtw (ORCPT ); Tue, 17 Mar 2015 12:49:52 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:38076 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932458AbbCQQtr (ORCPT ); Tue, 17 Mar 2015 12:49:47 -0400 Date: Tue, 17 Mar 2015 09:49:40 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Mathieu Desnoyers , linux-kernel@vger.kernel.org, KOSAKI Motohiro , Steven Rostedt , Nicholas Miell , Linus Torvalds , Ingo Molnar , Alan Cox , Lai Jiangshan , Stephen Hemminger , Andrew Morton , Josh Triplett , Thomas Gleixner , David Howells Subject: Re: [RFC PATCH] sys_membarrier(): system/process-wide memory barrier (x86) (v12) Message-ID: <20150317164940.GM3589@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1426447459-28620-1-git-send-email-mathieu.desnoyers@efficios.com> <20150316141939.GE21418@twins.programming.kicks-ass.net> <1203077851.9491.1426520636551.JavaMail.zimbra@efficios.com> <20150316172104.GH21418@twins.programming.kicks-ass.net> <1003922584.10662.1426532015839.JavaMail.zimbra@efficios.com> <20150316205435.GJ21418@twins.programming.kicks-ass.net> <910572156.13900.1426556725438.JavaMail.zimbra@efficios.com> <20150317063059.GJ2896@worktop.programming.kicks-ass.net> <680573370.19261.1426598016060.JavaMail.zimbra@efficios.com> <20150317163756.GE23123@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150317163756.GE23123@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15031716-0021-0000-0000-000009465A49 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2015 at 05:37:56PM +0100, Peter Zijlstra wrote: > On Tue, Mar 17, 2015 at 01:13:36PM +0000, Mathieu Desnoyers wrote: > > > Its basically: WMB + ACQUIRE, which theoretically can leak a read in, > > > but nobody sane _delays_ reads, you want to speculate reads, not > > > postpone. > > > > If I believe the memory ordering table at > > https://en.wikipedia.org/wiki/Memory_ordering , there appears > > to be quite a few architectures that can reorder loads after loads, > > and loads after stores: Alpha, ARMv7, PA-RISC, SPARC RMO, x86 oostore > > and ia64. There may be subtle details that would allow us to > > do without the barriers in specific situations, but for that I'd > > very much like to hear what Paul has to say. > > So I was starting to write that you can get load after load by one > speculating more than the other, but I suppose you can delay loads just > fine too. > > Imagine getting a cache miss on a load, the OoO engine can then continue > execution until it hits a hard dependency, so you're effectively > delaying the load. > > So yeah, if we want to be able to replace smp_rmb() with a > barrier+sys_membar() we need to promote the smp_mb__before_spinlock() to > smp_mb__after_unlock_lock() or so, that would only penalize PPC a bit. Agreed, though if Mathieu is dropping the expedited version for the moment, this should not be required yet, right? Thanx, Paul