From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [PATCH v6 4/5] MCS Lock: Barrier corrections Date: Wed, 4 Dec 2013 22:26:13 +0100 Message-ID: <20131204212613.GA21717@two.firstfloor.org> References: <1384911463.11046.454.camel@schen9-DESK> <20131120153123.GF4138@linux.vnet.ibm.com> <20131120154643.GG19352@mudshark.cambridge.arm.com> <20131120171400.GI4138@linux.vnet.ibm.com> <20131121110308.GC10022@twins.programming.kicks-ass.net> <20131121125616.GI3694@twins.programming.kicks-ass.net> <20131121132041.GS4138@linux.vnet.ibm.com> <20131121172558.GA27927@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20131121172558.GA27927@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org To: "Paul E. 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" , Linus Torvalds , 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 List-Id: linux-arch.vger.kernel.org > Let's apply the Intel manual to the earlier example: > > CPU 0 CPU 1 CPU 2 > ----- ----- ----- > x = 1; r1 = SLA(lock); y = 1; > SSR(lock, 1); r2 = y; smp_mb(); > r3 = x; > > assert(!(r1 == 1 && r2 == 0 && r3 == 0)); Hi Paul, We discussed this example with CPU architects and they agreed that it is valid to rely on (r1 == 1 && r2 == 0 && r3 == 0) never happening. So the MCS code is good without additional barriers. -Andi -- ak@linux.intel.com -- Speaking for myself only. -- 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