Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-17 Thread Raghavendra K T
On 07/17/2012 02:39 PM, Raghavendra K T wrote: [...] But if vcpu A is spinning for x% of its time and processing on the other, then vcpu B will flip its dy_eligible for those x%, and not flip it when it's processing. I don't understand how this is useful. Suppose A is doing really good job an

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-17 Thread Raghavendra K T
On 07/17/2012 01:59 PM, Avi Kivity wrote: On 07/16/2012 07:10 PM, Rik van Riel wrote: On 07/16/2012 06:07 AM, Avi Kivity wrote: +{ +bool eligible; + +eligible = !vcpu->ple.cpu_relax_intercepted || +(vcpu->ple.cpu_relax_intercepted&& + vcpu->ple.dy_eligible); + +

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-17 Thread Avi Kivity
On 07/16/2012 07:10 PM, Rik van Riel wrote: > On 07/16/2012 06:07 AM, Avi Kivity wrote: > >>> +{ >>> +bool eligible; >>> + >>> +eligible = !vcpu->ple.cpu_relax_intercepted || >>> +(vcpu->ple.cpu_relax_intercepted&& >>> + vcpu->ple.dy_eligible); >>> + >>> +if (vc

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-16 Thread Raghavendra K T
On 07/16/2012 03:37 PM, Avi Kivity wrote: On 07/16/2012 11:25 AM, Raghavendra K T wrote: From: Raghavendra K T Currently, on a large vcpu guests, there is a high probability of yielding to the same vcpu who had recently done a pause-loop exit or cpu relax intercepted. Such a yield can lead to t

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-16 Thread Raghavendra K T
On 07/16/2012 09:40 PM, Rik van Riel wrote: On 07/16/2012 06:07 AM, Avi Kivity wrote: +{ + bool eligible; + + eligible = !vcpu->ple.cpu_relax_intercepted || + (vcpu->ple.cpu_relax_intercepted&& + vcpu->ple.dy_eligible); + + if (vcpu->ple.cpu_relax_intercepted) + vcpu->ple.dy_eligible = !vcpu->p

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-16 Thread Rik van Riel
On 07/16/2012 06:07 AM, Avi Kivity wrote: +{ + bool eligible; + + eligible = !vcpu->ple.cpu_relax_intercepted || + (vcpu->ple.cpu_relax_intercepted&& +vcpu->ple.dy_eligible); + + if (vcpu->ple.cpu_relax_intercepted) +

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-16 Thread Avi Kivity
On 07/16/2012 11:25 AM, Raghavendra K T wrote: > From: Raghavendra K T > > Currently, on a large vcpu guests, there is a high probability of > yielding to the same vcpu who had recently done a pause-loop exit or > cpu relax intercepted. Such a yield can lead to the vcpu spinning > again and hence

[PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-16 Thread Raghavendra K T
From: Raghavendra K T Currently, on a large vcpu guests, there is a high probability of yielding to the same vcpu who had recently done a pause-loop exit or cpu relax intercepted. Such a yield can lead to the vcpu spinning again and hence degrade the performance. The patchset keeps track of the