From: Keir Fraser Subject: Re: [Patch 2 of 2]: PV-domain SMP performance Linux-part Date: Fri, 16 Jan 2009 10:41:05 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: James Harper , Juergen Gross , Venefax Cc: George Dunlap , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 16/01/2009 10:16, "James Harper" wrote: > I had previously wondered about optimizing spinlocks, my idea was > basically for Xen to set a bit in a structure to indicate what vcpus are > currently scheduled, and my modified spinlock acquire routine would > check if the current vcpu wants a spinlock that is held by a currently > unscheduled vcpu, and if so yield to Xen to let the other vcpu schedule. That's a lot more like our existing Linux pv_ops spinlock handling (yield/block instead of spin) than Juergen's patch (don't deschedule me while in a critical section). The difference from what you suggest is that we heuristically detect unscheduled lock holders by spinning a short while. You can pv up your Windows spinlocks in the block-instead-of-spin way already (and yield-instead-of-spin is obviously even easier). -- Keir