Re: [PATCH] kvmclock: Ensure time in migration never goes backward

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

 




On 06.05.14 01:23, Marcelo Tosatti wrote:
Hi Alexander,

On Mon, May 05, 2014 at 03:51:22PM +0200, Alexander Graf wrote:
When we migrate we ask the kernel about its current belief on what the guest
time would be.
KVM_GET_CLOCK which returns the time in "struct kvm_clock_data".

Yes :)


However, I've seen cases where the kvmclock guest structure
indicates a time more recent than the kvm returned time.
More details please:

1) By what algorithm you retrieve
and compare time in kvmclock guest structure and KVM_GET_CLOCK.
What are the results of the comparison.
And whether and backwards time was visible in the guest.

I've managed to get my hands on a broken migration stream from Nick. There I looked at the curr_clocksource structure and saw that the last seen time on the kvmclock clock source was greater than the value that the kvmclock device migrated.

2) What is the host clocksource.

The test below is not a good one because:

T1) KVM_GET_CLOCK (save s->clock).
T2) save env->tsc.

The difference in scaled time between T1 and T2 is larger than 1
nanosecond, so the

(time_at_migration > s->clock)

check is almost always positive (what matters though is whether
time backwards event can be seen reading kvmclock in the guest).

Yeah, at first I was thinking it makes sense to just not use the KVM_GET_CLOCK value at all because it's redundant to the in-memory values. Maybe that is the better alternative after all.


Alex

--
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