From: Olaf Hering <olaf@aepfle.de>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
xen-devel <xen-devel@lists.xenproject.org>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v13] tolerate jitter in cpu_khz calculation to avoid TSC emulation
Date: Wed, 13 Mar 2019 14:51:44 +0100 [thread overview]
Message-ID: <20190313145144.64b0f9fd.olaf@aepfle.de> (raw)
In-Reply-To: <5C88CAEF020000780021DFA6@prv1-mh.provo.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 1896 bytes --]
Am Wed, 13 Mar 2019 03:18:39 -0600
schrieb "Jan Beulich" <JBeulich@suse.com>:
> > + 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 #1.2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-03-13 13:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 8:28 [PATCH v13] tolerate jitter in cpu_khz calculation to avoid TSC emulation Olaf Hering
2019-03-13 9:18 ` Jan Beulich
2019-03-13 10:23 ` Olaf Hering
2019-03-13 10:38 ` Jan Beulich
2019-03-13 13:35 ` Olaf Hering
2019-03-13 14:30 ` Jan Beulich
2019-03-13 13:51 ` Olaf Hering [this message]
2019-03-13 14:36 ` Jan Beulich
2019-03-13 16:02 ` Olaf Hering
2019-03-14 11:58 ` Olaf Hering
2019-03-14 13:50 ` Olaf Hering
2019-03-14 14:10 ` Juergen Gross
2019-03-14 14:14 ` Olaf Hering
2019-03-14 14:24 ` Juergen Gross
2019-03-14 14:33 ` Olaf Hering
2019-03-14 14:36 ` Jan Beulich
2019-03-14 14:41 ` Olaf Hering
2019-03-19 14:20 ` Olaf Hering
2019-03-14 14:38 ` Juergen Gross
2019-03-14 14:46 ` Olaf Hering
2019-03-14 15:03 ` Juergen Gross
2019-03-14 14:20 ` Jan Beulich
2019-03-14 14:27 ` Olaf Hering
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190313145144.64b0f9fd.olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.