From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: "Xen-Devel (E-mail)" <xen-devel@lists.xensource.com>
Subject: Re: softtsc for PV guests
Date: Sun, 23 Aug 2009 10:03:21 -0700 [thread overview]
Message-ID: <4A917659.5030007@goop.org> (raw)
In-Reply-To: <549ae3d4-27e8-4689-8218-5e01261d2739@default>
On 08/23/09 09:42, Dan Magenheimer wrote:
> While I'm hoping that this is true, I am skeptical. The
> PV time algorithm does depend on TSC accuracy for interpolating
> over short intervals doesn't it?
>
Yes, it extrapolates, assuming that in the absence of power events, etc,
the tsc is stable over a period of a few seconds on a given CPU.
> Assuming an SMP PV guest starts on a machine with "safe TSC" (e.g. a
> recent multi-core single-socket) and migrates successively to
> a sequence of machines with:
>
> 1) a multi-socket where TSCs are not synchronized and skew badly
> 2) a different multi-core single-socket with a faster TSC frequencey
> 3) a multi-core/socket where TSC frequency varies according to
> per-cpu power-saving configuration
>
> does the SMP PV guest maintain time properly?
>
It uses timing parameters from Xen. If Xen can't keep track of the tsc
and events which affect it and provides bad info, it will fail. But
then it means that Xen can't use the tsc internally either, so
presumably won't be able to accurately emulate it either. The ABI never
assumes that the tsc is synchronized between CPUs, or that they're
running at even approximately the same rate.
The main risk is having the CPU asynchronously change speed under Xen,
with either no notification or a delayed notification (like thermal
events). Any synchronous speed change can be dealt with.
> And even if it does, this doesn't help applications that read
> TSC directly (which, admittedly, they shouldn't, but since
> the processor vendors have made TSC much "safer" on most
> systems, which will probably soon account for >90% of systems
> shipped, SMP app direct use of TSC will likely become more prevalent.)
>
Right. That's basically not supported under Linux, except as part of
certain ABIs like vgettimeofday (which is functionally identical to the
Xen PV clock ABI).
> It's dom0. I do see get an IP but it varies pretty widely from
> sample (of '0') to sample and I haven't tried a symbol lookup
> yet because I fear they will be buried in layers of block drivers
>
> I'm still hoping for some clue without digging that deep...
> All I've presumably done (assuming my patch doesn't have a weird
> bug) is make rdtsc slower.
>
It's presumed to be fast in a number of places, but it shouldn't cause
it to fail. Maybe some race is coming up. If you just revert the
register write to make rdtsc trap, does it still hang?
J
next prev parent reply other threads:[~2009-08-23 17:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-21 22:17 softtsc for PV guests Dan Magenheimer
2009-08-21 23:02 ` Jeremy Fitzhardinge
2009-08-21 23:31 ` Dan Magenheimer
2009-08-21 23:38 ` Dan Magenheimer
2009-08-21 23:59 ` Jeremy Fitzhardinge
2009-08-23 16:42 ` Dan Magenheimer
2009-08-23 17:03 ` Jeremy Fitzhardinge [this message]
2009-08-23 19:26 ` Dan Magenheimer
2009-08-24 16:43 ` Jeremy Fitzhardinge
2009-08-24 17:58 ` Dan Magenheimer
2009-08-24 21:20 ` Dan Magenheimer
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=4A917659.5030007@goop.org \
--to=jeremy@goop.org \
--cc=dan.magenheimer@oracle.com \
--cc=xen-devel@lists.xensource.com \
/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.