From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xenproject.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Wei Liu" <wei.liu2@citrix.com>,
"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
"George Dunlap" <George.Dunlap@eu.citrix.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Ian Jackson" <ian.jackson@eu.citrix.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
"Tim Deegan" <tim@xen.org>, "Julien Grall" <julien.grall@arm.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v10] new config option vtsc_tolerance_khz to avoid TSC emulation
Date: Tue, 11 Dec 2018 16:40:59 +0100 [thread overview]
Message-ID: <20181211154059.GC18447@aepfle.de> (raw)
In-Reply-To: <20181207085122.14171-1-olaf@aepfle.de>
[-- Attachment #1.1: Type: text/plain, Size: 2056 bytes --]
On Fri, Dec 07, Olaf Hering wrote:
> [ the math added to xen-tscmode.7 suggests that a domU should see a time
> drift, which ntpd corrects. But the actual correction reported in
> ntp.drift is entirely different than the one calculated in the
> example. To me it is unclear why the example is wrong, more research
> must be done. I'm sending this out just to get feedback about how
> exactly the per-host knob must be implemented. ]
>
> Add a knob to control when vTSC emulation will be activated for a domU
> with tsc_mode=default. Without such option each TSC access from domU
> will be emulated, which causes a significant perfomance drop for
> workloads that make use of rdtsc.
I wonder why this needs to be a config option at all.
I think that if a domU uses TSC as clocksoure it also must run NTP in
some way to avoid the potential drift what will most likely happen,
independent of any migration. And if it must do that, NTP will handle a
drift up to 500 PPM. This means 500us. But if a domU is moved from a
2.3GHz host to a 2.4GHz host the expected drift is much larger. The
clock will run slower, the amount of ticks representing a second happen
within a timespan of 0.958333 seonds. Adding the drift to that number
means an NTPd could correct up to 0.958833 seconds. This is out of
bounds either way.
If Xen already bases its decision to emulate TSC on bogus numbers,
shouldnt it automatically allow some tolerance for tsc_mode=default?
Xen itself can not know if the estimated value in cpu_khz is at the edge
or in the middle of the range of possible freqencies. If we assume the
total range is 200 KHz, and up to 500 PPM can be corrected, a possible
default tolerance would be like: [insert math here]
So I think the suggested vtsc_tolerance_khz should in fact add a local
static vtsc_tolerance_khz into xen/arch/x86/time.c, and tsc_set_info
should base the decision on this variable like it is already done in the
suggested patch. No admin tuning of this value is required IMO.
Olaf
[-- Attachment #1.2: signature.asc --]
[-- 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
prev parent reply other threads:[~2018-12-11 15:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-07 8:51 [PATCH v10] new config option vtsc_tolerance_khz to avoid TSC emulation Olaf Hering
2018-12-11 15:40 ` Olaf Hering [this message]
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=20181211154059.GC18447@aepfle.de \
--to=olaf@aepfle.de \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@arm.com \
--cc=konrad.wilk@oracle.com \
--cc=marmarek@invisiblethingslab.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--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.