I'm a bit worried about the kernel playing with the hypervisor'sFor Xen I explicitly made it not a problem by adding the notion of a
version field.
secondary pvclock_vcpu_time_info structure which is updated by copying,
aside from the version number which is updated as-is.
As far as I can tell it isn't a problem for KVM either. The guest
version number is atomic with respect to preemption by the hypervisor so
there's no scope for racing. (The ABI already guarantees that the
pvclock structures are never updated cross-cpu.)
It ultimately doesn't matter what the version number is so long as it
changes when the parameters are updated, and version numbers can't be
reused within a window where things get confused.
It's better to introduce yet a new version for the kernel, and checkTwo version numbers are awkward to read atomically at least on 32-bit.
both.
And I don't think its necessary.
It's sufficient to increment a version counter on thread migration, noThat's true; switch_out is a pessimistic approximation of that. But is
need to do it on context switch.
there a convenient hook to test for migration?