Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750789AbVLGPt6 (ORCPT ); Wed, 7 Dec 2005 10:49:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751155AbVLGPt5 (ORCPT ); Wed, 7 Dec 2005 10:49:57 -0500 Received: from mail1.kontent.de ([81.88.34.36]:50050 "EHLO Mail1.KONTENT.De") by vger.kernel.org with ESMTP id S1750789AbVLGPt4 (ORCPT ); Wed, 7 Dec 2005 10:49:56 -0500 From: Oliver Neukum To: Arjan van de Ven Subject: Re: [linux-usb-devel] Re: [PATCH 00/10] usb-serial: Switches from spin lock to atomic_t. Date: Wed, 7 Dec 2005 16:50:01 +0100 User-Agent: KMail/1.8 Cc: Alan Stern , linux-usb-devel@lists.sourceforge.net, Eduardo Pereira Habkost , Greg KH , Luiz Fernando Capitulino , linux-kernel@vger.kernel.org References: <200512071637.40018.oliver@neukum.org> <1133970015.2869.31.camel@laptopd505.fenrus.org> In-Reply-To: <1133970015.2869.31.camel@laptopd505.fenrus.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512071650.01439.oliver@neukum.org> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1234 Lines: 28 Am Mittwoch, 7. Dezember 2005 16:40 schrieben Sie: > On Wed, 2005-12-07 at 16:37 +0100, Oliver Neukum wrote: > > Am Mittwoch, 7. Dezember 2005 16:22 schrieb Arjan van de Ven: > > > > 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 are refering to SMP, aren't you? > > yes. > on UP neither is a locked instruction ;) But the atomic variant has to guard against interrupts, at least on architectures that do load/store only, hasn't it? AFAICT it is even theoretically impossible to tell for the compiler whether a function is always called with interrupts off. Regards Oliver - 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/