Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932102AbWHCBSH (ORCPT ); Wed, 2 Aug 2006 21:18:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932108AbWHCBSH (ORCPT ); Wed, 2 Aug 2006 21:18:07 -0400 Received: from mailout1.vmware.com ([65.113.40.130]:31699 "EHLO mailout1.vmware.com") by vger.kernel.org with ESMTP id S932102AbWHCBSF (ORCPT ); Wed, 2 Aug 2006 21:18:05 -0400 Message-ID: <44D14ECC.3080600@vmware.com> Date: Wed, 02 Aug 2006 18:18:04 -0700 From: Zachary Amsden User-Agent: Thunderbird 1.5.0.4 (X11/20060516) MIME-Version: 1.0 To: Christoph Lameter Cc: Jeremy Fitzhardinge , Jeremy Fitzhardinge , akpm@osdl.org, linux-kernel@vger.kernel.org, virtualization@lists.osdl.org, xen-devel@lists.xensource.com, Ian Pratt , Christian Limpach , Chris Wright Subject: Re: [patch 2/8] Implement always-locked bit ops, for memory shared with an SMP hypervisor. References: <20060803002510.634721860@xensource.com> <20060803002518.061401577@xensource.com> <44D144EC.3000205@goop.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1266 Lines: 26 Christoph Lameter wrote: > Thats a good goal but what about the rest of us who have to maintain > additional forms of bit operations for all architectures. How much is this > burden? Are locked atomic bitops really that more expensive? > It needn't be all architectures yet - only architectures that want to compile Xen drivers are really affected. Perhaps a better place for these locking primitives is in a Xen-specific driver header which defines appropriate primitives for the architectures required? Last I remember, there were still some issues here where atomic partial word operations couldn't be supported on some architectures. To answer your question, yes. On most i386 cores, locks destroy performance, and even unintentional use of a single locked operation in a critical path, on uncontended local memory, can have several hundred cycles downstream penalty. I accidentally used one once during context switch, and saw a 30% reduction in switch performance - on a modern processor. Zach - 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/