Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751168AbVLGQBs (ORCPT ); Wed, 7 Dec 2005 11:01:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751170AbVLGQBs (ORCPT ); Wed, 7 Dec 2005 11:01:48 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:51331 "HELO iolanthe.rowland.org") by vger.kernel.org with SMTP id S1751168AbVLGQBs (ORCPT ); Wed, 7 Dec 2005 11:01:48 -0500 Date: Wed, 7 Dec 2005 11:01:46 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Arjan van de Ven cc: Oliver Neukum , , Eduardo Pereira Habkost , Greg KH , Luiz Fernando Capitulino , Subject: Re: [linux-usb-devel] Re: [PATCH 00/10] usb-serial: Switches from spin lock to atomic_t. In-Reply-To: <1133968943.2869.26.camel@laptopd505.fenrus.org> Message-ID: 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: 999 Lines: 24 On Wed, 7 Dec 2005, Arjan van de Ven wrote: > > On the other hand, Oliver needs to be careful about claiming too much. In > > general atomic_t operations _are_ superior to the spinlock approach. > > No they're not. Both are just about equally expensive cpu wise, > sometimes the atomic_t ones are a bit more expensive (like on parisc > architecture). But on x86 in either case it's a locked cycle, which is > just expensive no matter which side you flip the coin... You're overgeneralizing. Sure, a locked cycle has a certain expense. But it's a lot less than the expense of a contested spinlock. On the other hand, many times UP systems can eliminate spinlocks entirely. There are lots of variables and many possible tradeoffs. Alan Stern - 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/