Re: kvm guest loops_per_jiffy miscalibration under host load

Marcelo Tosatti
2008-07-04T23:02:00Z

Hi Glauber,

On Thu, Jul 03, 2008 at 10:17:05AM -0300, Glauber Costa wrote:
>> - Require the admin to preset "lpj=". Nasty, not user friendly.
>> - Pass the proper lpj value via a paravirt interface. Won't cover
>> fullvirt guests.
>> - Have the management app guarantee a minimum amount of CPU required
>> for proper calibration during guest initialization.
> I don't like any of these solutions, and won't defend any of "the one".
> So no hard feelings. But I think the "less worse" among them IMHO is the
> paravirt one. At least it goes in the general direction of "paravirt if
> you need to scale over xyz".

What is worse is that this problem can happen with a single guest, given
enough lack of CPU power to the qemu process.

> I think passing lpj is out of question, and giving the cpu resources for
> that time is kind of a kludge.

Yeah, but reserving cpu resources is the only automatic solution I can
think of for fullvirt guests.

> Or maybe we could put the timer expiration alone in a separate thread,
> with maximum priority (maybe rt priority)? dunno...

The timer expiration already has high priority, since its emulated with
host kernel timers, so they're pretty close to the real hardware timing.

Problem is if the guest is not given enough CPU power to run the
calibration routines.