Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758901AbXFZR0y (ORCPT ); Tue, 26 Jun 2007 13:26:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757266AbXFZR0r (ORCPT ); Tue, 26 Jun 2007 13:26:47 -0400 Received: from smtp2.linux-foundation.org ([207.189.120.14]:59529 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756978AbXFZR0q (ORCPT ); Tue, 26 Jun 2007 13:26:46 -0400 Date: Tue, 26 Jun 2007 10:23:59 -0700 (PDT) From: Linus Torvalds To: Nick Piggin cc: Eric Dumazet , Chuck Ebbert , Ingo Molnar , Jarek Poplawski , Miklos Szeredi , chris@atlee.ca, linux-kernel@vger.kernel.org, tglx@linutronix.de, akpm@linux-foundation.org Subject: Re: [BUG] long freezes on thinkpad t60 In-Reply-To: <4680D162.9050603@yahoo.com.au> Message-ID: References: <20070620093612.GA1626@ff.dom.local> <20070621073031.GA683@elte.hu> <20070621160817.GA22897@elte.hu> <467AAB04.2070409@redhat.com> <20070621202917.a2bfbfc7.dada1@cosmosbay.com> <4680D162.9050603@yahoo.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1258 Lines: 31 On Tue, 26 Jun 2007, Nick Piggin wrote: > > Hmm, not that I have a strong opinion one way or the other, but I > don't know that they would encourage bad code. They are not going to > reduce latency under a locked section, but will improve determinism > in the contended case. xadd really generally *is* slower than an add. One is often microcoded, the other is not. But the real problem is that your "unlock" sequence is now about two orders of magnitude slower than it used to be. So it used to be that a spinlocked sequence only had a single synchronization point, now it has two. *That* is really bad, and I guarantee that it makes your spinlocks effectively twice as slow for the non-contended parts. But your xadd thing might be worth looking at, just to see how expensive it is. As an _alternative_ to spinlocks, it's certainly viable. (Side note: why make it a word? Word operations are slower on many x86 implementations, because they add yet another prefix. You only need a byte) Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/