From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with SMTP id 526016B00F0 for ; Tue, 5 Jan 2010 14:16:22 -0500 (EST) Date: Tue, 5 Jan 2010 13:15:53 -0600 (CST) From: Christoph Lameter Subject: Re: [RFC][PATCH 6/8] mm: handle_speculative_fault() In-Reply-To: Message-ID: References: <20100104182429.833180340@chello.nl> <20100104182813.753545361@chello.nl> <20100105092559.1de8b613.kamezawa.hiroyu@jp.fujitsu.com> <28c262361001042029w4b95f226lf54a3ed6a4291a3b@mail.gmail.com> <20100105134357.4bfb4951.kamezawa.hiroyu@jp.fujitsu.com> <20100105143046.73938ea2.kamezawa.hiroyu@jp.fujitsu.com> <20100105163939.a3f146fb.kamezawa.hiroyu@jp.fujitsu.com> <87wrzwbh0z.fsf@basil.nowhere.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Linus Torvalds Cc: Andi Kleen , KAMEZAWA Hiroyuki , Minchan Kim , Peter Zijlstra , "Paul E. McKenney" , Peter Zijlstra , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "hugh.dickins" , Nick Piggin , Ingo Molnar List-ID: On Tue, 5 Jan 2010, Linus Torvalds wrote: > Don't you see the problem? The spinlock (with ticket locks) essentially > does the "xadd" atomic increment anyway, but then it _waits_ for it. All > totally pointless, and all just making for problems, and wasting CPU time > and causing more cross-node traffic. For the xadd to work it first would have to acquire the cacheline exclusively. That can only occur for a single processor and with the fitting minimum holdtime for exclusive cachelines everything should be fine. If the critical section is done (unlock complete) then the next processor (which had to stopped waiting to access the cacheline) can acquire the lock. The wait state is the processor being stopped due to not being able to access the cacheline. Not the processor spinning in the xadd loop. That only occurs if the critical section is longer than the timeout. -- 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