From: Keir Fraser Subject: Re: credit scheduler and HYPERVISOR_yield() Date: Mon, 15 Oct 2007 18:45:52 +0100 Message-ID: References: <62a4e0ddaadc2502a86b8bfae4a35caa@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <62a4e0ddaadc2502a86b8bfae4a35caa@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Emmanuel Ackaouy , George Dunlap Cc: xen-devel@lists.xensource.com, John Levon List-Id: xen-devel@lists.xenproject.org On 15/10/07 18:13, "Emmanuel Ackaouy" wrote: > In the case of IPIs, you're already going into the hypervisor so you > should be able to do something straightforward with a sleeping > semaphore. Maybe you spin a little before you sleep though to give > running VCPUs a chance to respond before you give up the end of > your time slice. Actually a blocking spinlock could be implemented with no Xen changes. Change the spinlock function in Linux to spin a few times and then set a waiting bit in a cpumask and then SCHEDOP_poll on a per-VCPU spinlock-wakeup event channel. On spin_unlock, the unlocker sends an event to any VCPU in the cpumask, using each VCPU's spinlock-wakeup event channel. Yes, this is probably nicer than using yield() and praying. -- Keir