From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH v6 4/5] MCS Lock: Barrier corrections Date: Tue, 26 Nov 2013 17:05:14 -0800 Message-ID: References: <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> <20131126192003.GA4137@linux.vnet.ibm.com> <20131126225136.GG4137@linux.vnet.ibm.com> <20131127003904.GI4137@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20131127003904.GI4137@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org To: Paul McKenney Cc: Peter Zijlstra , 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" List-Id: linux-arch.vger.kernel.org On Tue, Nov 26, 2013 at 4:39 PM, Paul E. McKenney wrote: > > Cross-CPU ordering. Ok, in that case I *suspect* we want an actual "spin_lock_mb()" primitive, because if we go with the MCS lock approach, it's quite possible that we find cases where the fast-case is already a barrier (like it is on x86 by virtue of the locked instruction) but the MCS case then is not. And then a separate barrier wouldn't be able to make that kind of judgement. Or maybe we don't care enough. It *sounds* like on x86, we do probably already get the cross-cpu case for free, and on other architectures we may always need the memory barrier, so maybe the whole "mb_after_spin_lock()" thing is fine. Ugh. Linus -- 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