Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-10-11 Thread Avi Kivity
On 10/09/2009 12:03 PM, Zhai, Edwin wrote: Tosatti, See attached patch. Avi, Could you pls. do the check in if no any other comments. Looks reasonable to me (Marcelo commits this week). -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-10-02 Thread Marcelo Tosatti
On Wed, Sep 30, 2009 at 01:22:49PM -0300, Marcelo Tosatti wrote: On Wed, Sep 30, 2009 at 09:01:51AM +0800, Zhai, Edwin wrote: Avi, I modify it according your comments. The only thing I want to keep is the module param ple_gap/window. Although they are not per-guest, they can be used

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-30 Thread Avi Kivity
On 09/30/2009 03:01 AM, Zhai, Edwin wrote: Avi, I modify it according your comments. The only thing I want to keep is the module param ple_gap/window. Although they are not per-guest, they can be used to find the right value, and disable PLE for debug purpose. Fair enough, ACK. -- Do not

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-30 Thread Marcelo Tosatti
On Wed, Sep 30, 2009 at 09:01:51AM +0800, Zhai, Edwin wrote: Avi, I modify it according your comments. The only thing I want to keep is the module param ple_gap/window. Although they are not per-guest, they can be used to find the right value, and disable PLE for debug purpose. Thanks,

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-29 Thread Zhai, Edwin
Avi, Any comments for this new patch? Thanks, Zhai, Edwin wrote: Avi Kivity wrote: +#define KVM_VMX_DEFAULT_PLE_GAP41 +#define KVM_VMX_DEFAULT_PLE_WINDOW 4096 +static int __read_mostly ple_gap = KVM_VMX_DEFAULT_PLE_GAP; +module_param(ple_gap, int, S_IRUGO); + +static int __read_mostly

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-29 Thread Avi Kivity
On 09/28/2009 11:33 AM, Zhai, Edwin wrote: Avi Kivity wrote: +#define KVM_VMX_DEFAULT_PLE_GAP41 +#define KVM_VMX_DEFAULT_PLE_WINDOW 4096 +static int __read_mostly ple_gap = KVM_VMX_DEFAULT_PLE_GAP; +module_param(ple_gap, int, S_IRUGO); + +static int __read_mostly ple_window =

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-29 Thread Avi Kivity
On 09/27/2009 04:53 PM, Joerg Roedel wrote: Depends. If it's a global yield(), yes. If it's a local yield() that doesn't rebalance the runqueues we might be left with the spinning task re-running. Only one runable task on each cpu is unlikely in a situation of high vcpu overcommit

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-29 Thread Zhai, Edwin
Avi, I modify it according your comments. The only thing I want to keep is the module param ple_gap/window. Although they are not per-guest, they can be used to find the right value, and disable PLE for debug purpose. Thanks, Avi Kivity wrote: On 09/28/2009 11:33 AM, Zhai, Edwin wrote:

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-28 Thread Zhai, Edwin
Avi Kivity wrote: +#define KVM_VMX_DEFAULT_PLE_GAP41 +#define KVM_VMX_DEFAULT_PLE_WINDOW 4096 +static int __read_mostly ple_gap = KVM_VMX_DEFAULT_PLE_GAP; +module_param(ple_gap, int, S_IRUGO); + +static int __read_mostly ple_window = KVM_VMX_DEFAULT_PLE_WINDOW; +module_param(ple_window,

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-27 Thread Avi Kivity
On 09/25/2009 04:11 AM, Zhai, Edwin wrote: Avi, hrtimer is used for sleep in attached patch, which have similar perf gain with previous one. Maybe we can check in this patch first, and turn to direct yield in future, as you suggested. +/* + * These 2 parameters are used to config the

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-27 Thread Avi Kivity
On 09/25/2009 11:43 PM, Joerg Roedel wrote: On Wed, Sep 23, 2009 at 05:09:38PM +0300, Avi Kivity wrote: We haven't sorted out what is the correct thing to do here. I think we should go for a directed yield, but until we have it, you can use hrtimers to sleep for 100 microseconds and hope

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-27 Thread Joerg Roedel
On Sun, Sep 27, 2009 at 10:31:21AM +0200, Avi Kivity wrote: On 09/25/2009 11:43 PM, Joerg Roedel wrote: On Wed, Sep 23, 2009 at 05:09:38PM +0300, Avi Kivity wrote: We haven't sorted out what is the correct thing to do here. I think we should go for a directed yield, but until we have it,

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-27 Thread Avi Kivity
On 09/27/2009 03:46 PM, Joerg Roedel wrote: We can't find exactly which vcpu, but we can: - rule out threads that are not vcpus for this guest - rule out threads that are already running A major problem with sleep() is that it effectively reduces the vm priority relative to guests that don't

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-27 Thread Joerg Roedel
On Sun, Sep 27, 2009 at 03:47:55PM +0200, Avi Kivity wrote: On 09/27/2009 03:46 PM, Joerg Roedel wrote: We can't find exactly which vcpu, but we can: - rule out threads that are not vcpus for this guest - rule out threads that are already running A major problem with sleep() is that it

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-27 Thread Avi Kivity
On 09/27/2009 04:07 PM, Joerg Roedel wrote: On Sun, Sep 27, 2009 at 03:47:55PM +0200, Avi Kivity wrote: On 09/27/2009 03:46 PM, Joerg Roedel wrote: We can't find exactly which vcpu, but we can: - rule out threads that are not vcpus for this guest - rule out threads that are

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-27 Thread Joerg Roedel
On Sun, Sep 27, 2009 at 04:18:00PM +0200, Avi Kivity wrote: On 09/27/2009 04:07 PM, Joerg Roedel wrote: On Sun, Sep 27, 2009 at 03:47:55PM +0200, Avi Kivity wrote: On 09/27/2009 03:46 PM, Joerg Roedel wrote: We can't find exactly which vcpu, but we can: - rule out

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-25 Thread Joerg Roedel
On Wed, Sep 23, 2009 at 05:09:38PM +0300, Avi Kivity wrote: We haven't sorted out what is the correct thing to do here. I think we should go for a directed yield, but until we have it, you can use hrtimers to sleep for 100 microseconds and hope the holding vcpu will get scheduled.

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-24 Thread Zhai, Edwin
Avi, hrtimer is used for sleep in attached patch, which have similar perf gain with previous one. Maybe we can check in this patch first, and turn to direct yield in future, as you suggested. Thanks, edwin Avi Kivity wrote: On 09/23/2009 05:04 PM, Zhai, Edwin wrote: Avi, This is the

[PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-23 Thread Zhai, Edwin
Avi, This is the patch to enable PLE, which depends on the a small change of Linux scheduler (see http://lkml.org/lkml/2009/5/20/447). According to our discussion last time, one missing part is that if PLE exit, pick up an unscheduled vcpu at random and schedule it. But further investigation

Re: [PATCH] [RESEND] KVM:VMX: Add support for Pause-Loop Exiting

2009-09-23 Thread Avi Kivity
On 09/23/2009 05:04 PM, Zhai, Edwin wrote: Avi, This is the patch to enable PLE, which depends on the a small change of Linux scheduler (see http://lkml.org/lkml/2009/5/20/447). According to our discussion last time, one missing part is that if PLE exit, pick up an unscheduled vcpu at random