WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Fast inter-VM signaling using monitor/mwait

To: Michael Abd-El-Malek <mabdelmalek@xxxxxxx>, "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Subject: Re: [Xen-devel] Fast inter-VM signaling using monitor/mwait
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 06 May 2009 16:05:37 +0100
Cc: Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 06 May 2009 08:07:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <F27950A8-349D-494F-A5EA-9EA71771CAD0@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcnOWGPUTIztX0gtTtSSFMOzEKtrgQAA7jVZ
Thread-topic: [Xen-devel] Fast inter-VM signaling using monitor/mwait
User-agent: Microsoft-Entourage/12.17.0.090302
On 06/05/2009 15:38, "Michael Abd-El-Malek" <mabdelmalek@xxxxxxx> wrote:

>> In Xen actual vcpu scheduling happens at the point before resuming
>> back to VM, instead of in timer interrupt ISR. So as long as your
>> monitor/mwait loop in hypercall doesn't exit before update is
>> observed,
>> scheduling won't happen.
> 
> I'm not an expert on Xen scheduling, so please correct my following
> understanding.  For the credit scheduler, csched_tick sets the next
> timer interrupt.  So after the mwait hypercall executes the mwait
> instruction and is waiting for a memory write, I observe the timer
> interrupt eventually causing the mwait instruction to return.  The
> mwait hypercall can then run the scheduler.

The issue is, what if another VM's VCPUs are runnable? Xen should prefer to
run those rather than pause the CPU on an MWAIT, right? But if it does that
it will lose the memory-access wakeup property of the MWAIT and cannot
schedule the 'MWAIT'ing VM back in promptly when the relevant memory access
occurs. I don't see that MWAIT can used effectively in a guest idle loop
unless you are happy to bin the work-conserving property of the Xen
scheduler (e.g., by dedicating a physical CPU to the VM).

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel