Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268476AbUILFch (ORCPT ); Sun, 12 Sep 2004 01:32:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268479AbUILFcg (ORCPT ); Sun, 12 Sep 2004 01:32:36 -0400 Received: from dragnfire.mtl.istop.com ([66.11.160.179]:61656 "EHLO dsl.commfireservices.com") by vger.kernel.org with ESMTP id S268476AbUILF3Q (ORCPT ); Sun, 12 Sep 2004 01:29:16 -0400 Date: Sun, 12 Sep 2004 01:33:51 -0400 (EDT) From: Zwane Mwaikambo To: Nick Piggin Cc: Andrew Morton , torvalds@osdl.org, paulus@samba.org, linux-kernel@vger.kernel.org, anton@samba.org, jun.nakajima@intel.com, ak@suse.de, mingo@elte.hu Subject: Re: [PATCH] Yielding processor resources during lock contention In-Reply-To: <4143D16F.30500@yahoo.com.au> Message-ID: References: <16703.60725.153052.169532@cargo.ozlabs.ibm.com> <20040911220003.0e9061ad.akpm@osdl.org> <4143D16F.30500@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: 1195 Lines: 28 On Sun, 12 Sep 2004, Nick Piggin wrote: > > Well currently it just enables preempt and spins like a mad man until the > > lock is free. The idea is to allow preempt to get some scheduling done > > during the spin.. But! if you accept this patch today, you get the > > i386 version which will allow your processor to halt until a write to the > > lock occurs whilst allowing interrupts to also trigger the preempt > > scheduling, much easier on the caches. > > > > That's the idea though isn't it? If your locks are significantly more > expensive than a context switch and associated cache trashing, use a > semaphore, hypervisor or no. > > I presume the hypervisor switch much incur the same sorts of costs as > a context switch? In the PPC64 and P4/HT case the spinning on a lock is a bad utilisation of the execution resources and that's what we're really trying to avoid, not necessarily cache thrashing from a context switch. Zwane - 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/