Re: TSC deadline timer in guests vs. migration?

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

 




On 04/07/2016 21:07, Eduardo Habkost wrote:
> On Mon, Jul 04, 2016 at 01:01:42PM +0200, Paolo Bonzini wrote:
>> Can 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 data center is
>> perfectly homogeneous.
> 
> I believe it can. Also: what about everything else the guest may
> try to use the TSC for? (even without TSC deadline timer)

Luckily there isn't much that uses it directly.  Userspace should not
trust the TSC.  In practice there's quite some code that uses it for
performance measurement, but probably not for timekeeping.

> From a quick look at Linux code, it looks like the TSC
> clocksource code is more strict (but the exact rules are hard to
> follow), but it will still use the TSC in native_sched_clock().

This is not a big problem because KVM pvops override sched_clock to
kvm_clock_read().

> What about kvmclock? Do we have a mechanism to trigger a re-read
> of TSC frequency from the hypervisor?

Yes, that's the point of kvmclock.  Every time the TSC frequency changes
(which includes the first time you start the VCPU on a new host), the
kvmclock pages are updated with new data.

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