From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261889AbVANEOe (ORCPT ); Thu, 13 Jan 2005 23:14:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261897AbVANEOe (ORCPT ); Thu, 13 Jan 2005 23:14:34 -0500 Received: from colin2.muc.de ([193.149.48.15]:14852 "HELO colin2.muc.de") by vger.kernel.org with SMTP id S261889AbVANEOX (ORCPT ); Thu, 13 Jan 2005 23:14:23 -0500 Date: 14 Jan 2005 05:14:21 +0100 Date: Fri, 14 Jan 2005 05:14:21 +0100 From: Andi Kleen To: Roman Zippel Cc: Christoph Lameter , Andrew Morton , nickpiggin@yahoo.com.au, torvalds@osdl.org, hugh@veritas.com, linux-mm@kvack.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, benh@kernel.crashing.org Subject: Re: page table lock patch V15 [0/7]: overview Message-ID: <20050114041421.GA41559@muc.de> References: <41E4BCBE.2010001@yahoo.com.au> <20050112014235.7095dcf4.akpm@osdl.org> <20050112104326.69b99298.akpm@osdl.org> <41E73EE4.50200@linux-m68k.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E73EE4.50200@linux-m68k.org> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 14, 2005 at 04:39:16AM +0100, Roman Zippel wrote: > Hi, > > Christoph Lameter wrote: > > >Introduction of the cmpxchg is one atomic operations that replaces the two > >spinlock ops typically necessary in an unpatched kernel. Obtaining the > >spinlock requires an spinlock (which is an atomic operation) and then the > >release involves a barrier. So there is a net win for all SMP cases as far > >as I can see. > > But there might be a loss in the UP case. Spinlocks are optimized away, > but your cmpxchg emulation enables/disables interrupts with every access. Only for 386s and STI/CLI is quite cheap there. -Andi