Re: [PATCH RFC] KVM: busy-spin detector

Marcelo Tosatti
2010-06-11T17:47:43Z

On Fri, Jun 11, 2010 at 07:36:34PM +0530, Balbir Singh wrote:
> * Marcelo Tosatti <mtosatti@redhat.com> [2010-06-10 23:25:51]:
>
> >
> > The following patch implements a simple busy-spin detector. It considers
> > a vcpu as busy-spinning if there are two consecutive exits due to
> > external interrupt on the same RIP, and sleeps for 100us in that case.
> >
> > It is very likely that if the vcpu is making progress it will either
> > exit for other reasons or change RIP.
> >
> > The percentage numbers below represent improvement in kernel build
> > time in comparison with mainline (RHEL 5.4 guest).
> >
>
> Interesting approach, is there a reason to tie it in with pause loop
> exits?

Hum, i don't see any. PLE exits provide the same detection, but more
accurately.

> Can't we do something more generic or even para-virtish.

This is pretty generic already? Or what do you mean?

The advantage is it does not require paravirt modifications in the
guest (at the expense of guessing what the guest is doing).