From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-f41.google.com (mail-qa0-f41.google.com [209.85.216.41]) by kanga.kvack.org (Postfix) with ESMTP id F3E786B0096 for ; Tue, 26 Nov 2013 14:21:58 -0500 (EST) Received: by mail-qa0-f41.google.com with SMTP id j5so4785076qaq.7 for ; Tue, 26 Nov 2013 11:21:58 -0800 (PST) Received: from merlin.infradead.org (merlin.infradead.org. [2001:4978:20e::2]) by mx.google.com with ESMTPS id n6si32945545qel.147.2013.11.26.11.21.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Nov 2013 11:21:57 -0800 (PST) Date: Tue, 26 Nov 2013 20:21:33 +0100 From: Peter Zijlstra Subject: Re: [PATCH v6 4/5] MCS Lock: Barrier corrections Message-ID: <20131126192133.GF789@laptop.programming.kicks-ass.net> References: <20131121221859.GH4138@linux.vnet.ibm.com> <20131122155835.GR3866@twins.programming.kicks-ass.net> <20131122182632.GW4138@linux.vnet.ibm.com> <20131122185107.GJ4971@laptop.programming.kicks-ass.net> <20131125173540.GK3694@twins.programming.kicks-ass.net> <20131125180250.GR4138@linux.vnet.ibm.com> <20131125182715.GG10022@twins.programming.kicks-ass.net> <20131125235252.GA4138@linux.vnet.ibm.com> <20131126095945.GI10022@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: "Paul E. McKenney" , Will Deacon , Tim Chen , Ingo Molnar , Andrew Morton , Thomas Gleixner , "linux-kernel@vger.kernel.org" , linux-mm , "linux-arch@vger.kernel.org" , Waiman Long , Andrea Arcangeli , Alex Shi , Andi Kleen , Michel Lespinasse , Davidlohr Bueso , Matthew R Wilcox , Dave Hansen , Rik van Riel , Peter Hurley , Raghavendra K T , George Spelvin , "H. Peter Anvin" , Arnd Bergmann , Aswin Chandramouleeswaran , Scott J Norton , "Figo.zhang" , Oleg Nesterov On Tue, Nov 26, 2013 at 11:00:50AM -0800, Linus Torvalds wrote: > On Tue, Nov 26, 2013 at 1:59 AM, Peter Zijlstra wrote: > > > > If you now want to weaken this definition, then that needs consideration > > because we actually rely on things like > > > > spin_unlock(l1); > > spin_lock(l2); > > > > being full barriers. > > Btw, maybe we should just stop that assumption. I'd be fine with that; it was one of the options listed. I was just somewhat concerned that the definitions given by the Document and the reality of proposed implementations was drifting. > IOW, where do we really care about the "unlock+lock" is a memory > barrier? And could we make those places explicit, and then do > something similar to the above to them? So I don't know :-( I do know myself and Oleg have often talked about it, and I'm fairly sure we must have used it at some point. I think that introduction of smp_mb__before_spinlock() actually killed a few of those, but I can't recall. Oleg doesn't actually seem to be on the CC list -- lets amend that. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org