Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v2)

Chris Wright
2010-12-03T02:42:55Z

* Anthony Liguori (anthony@codemonkey.ws) wrote:
> On 12/02/2010 03:07 PM, Chris Wright wrote:
> >Like non-trapping hlt, that too will guarantee that the guest is preempted
> >by timeslice exhaustion (and is simpler than non-trapping hlt). So it
> >may well be the simplest for the case where we are perfectly committed
> >(i.e. the vcpu fractional core count totals the pcpu count). But once
> >we are undercommitted we still need some extra logic to handle the hard
> >cap and something to kick the running guest off the cpu and suck up the
> >extra cycles in a power conserving way.
>
> I'm not entirely sure TBH.
>
> If you think of a cloud's per-VCPU capacity in terms of Compute
> Units, having a model where a VCPU maps to 1-3 units depending on
> total load is potentially interesting particularly if the VCPU's
> capacity only changes in discrete amounts, that the expected
> capacity is communicated to the guest, and that the capacity only
> changes periodically.

OK, let's say a single PCPU == 12 Compute Units.

If the guest is the first to migrate to a newly added unused host, and
we are using either non-trapping hlt or Marcelo's non-yielding trapping
hlt, then that guest is going to get more CPU than it expected unless
there is some throttling mechanism. Specifically, it will get 12CU
instead of 1-3CU.

Do you agree with that?

thanks,
-chris