Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 06/07/2016 15:01, Andy Lutomirski wrote:
> On Jul 5, 2016 1:36 PM, "Paolo Bonzini" <pbonzini@xxxxxxxxxx> wrote:
>>
>> Bad things happen if a guest using the TSC deadline timer is migrated.
>> The guest doesn't re-calibrate the TSC after migration, and the
>> TSC frequency can and will change unless your processor supports TSC
>> scaling (on Intel this is only Skylake) or your data center is perfectly
>> homogeneous.
>>
>> The solution in this patch is to skip tsc_khz, and instead derive the
>> frequency from kvmclock's (mult, shift) pair.  Because kvmclock
>> parameters convert from tsc to nanoseconds, this needs a division
>> but that's the least of our problems when the TSC_DEADLINE_MSR write
>> costs 2000 clock cycles.  Luckily tsc_khz is really used by very little
>> outside the tsc clocksource (which kvmclock replaces) and the TSC
>> deadline timer.
> 
> I'm wondering if it would be more straightforward to blacklist the
> APIC timer entirely (on KVM guests that have the TSC deadline
> capability) and to instead offer a paravirt clockevent that still uses
> the deadline timer under the hood.  After all, these systems should be
> mostly quirk-free, so I imagine that the whole implementation would
> only be a few lines of code.

Very good idea!

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux