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

Re: [Xen-devel] [PATCH v13] tolerate jitter in cpu_khz calculation to avoid TSC emulation



Am Wed, 13 Mar 2019 03:18:39 -0600
schrieb "Jan Beulich" <JBeulich@xxxxxxxx>:

> > +    if ( tmp >= VTSC_MEASUREMENT_INACCURACY_RANGE_KHZ )
> > +        tmp -= VTSC_MEASUREMENT_INACCURACY_RANGE_KHZ;  
> The discontinuity is still there, and so far you've failed to explain
> why a discontinuity is what you want here.

This exists to make sure the non-emulated case stays within the PPM range.

But there is one more aspect to it that was not mentioned or covered:

The cpu_khz value used by Xen and its equivalent in dom0 or domU is just
a base frequency. ntpd will calculate the drift based on the external
source. That drift I think is what the PPM value is really all about.

If some frequency was measured and ntpd calculated some drift that is
close but not beyond the limit, then it can adjust the system clock as
needed. Once that domU is migrated to another, equally inaccurate host
Xen may decide that its cpu_khz value and the value expected by the domU
is still within the assumed PPM limit. As a result the time within the
domU may advance now in a slightly different speed, which is outside
that PPM limit. Now ntpd would stop synchronizing the system clock.
The correct action would be to emulate. But, Xen has no info at all what
the drift of its own clock actually is. All it has is that cpu_khz thing.

So ideally next to that cpu_khz value should be the drift value of a
given host to allow calculation of the real frequency. That frequency
will still vary to some degree according to various docs, but it would
be more accurate than the current cpu_khz value. If Xen had such feature
it would be in a better position to compare the frequency of two hosts.

In my case for example, if both of my hosts report an identical cpu_khz,
the ntp.drift file is 22 for one host and 4 for the other. So the real
frequency does actually differ.

Olaf

Attachment: pgptRMNP_ruxS.pgp
Description: Digitale Signatur von OpenPGP

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.