Re: [Xen-devel] [PATCH 05/12] xen/pvclock: add monotonicity check

From: Jeremy Fitzhardinge
Date: Sun Oct 18 2009 - 04:18:21 EST


On 10/17/09 02:58, john stultz wrote:
>> (I can think of plenty of ways of doing it incorrectly, where you'd get
>> apparent non-monotonicity regardless of the quality of the time source.)
>>
> There's been some interesting talk of creating a more offset-robust TSC
> clocksource using a per-cpu TSC offsets synced periodically against a
> global counter like the HPET. It seems like it could work, but there
> are a lot of edge cases and it really has to be right all of the time,
> so I don't think its quite as trivial as some folks have thought. But it
> would be interesting to see!
>

Xen and KVM do this already. The host system provides the tsc rate and
offset information for each cpu so that the guest kernel can compute a
global system time (ns since boot) from the tsc.

I suspect its quite difficult to guarantee that you get completely
monotonic results if the tscs are at different rates, but if they're the
same rate but merely offset it should give completely OK results.

J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/