From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: "Xen-Devel (E-mail)" <xen-devel@lists.xensource.com>,
Keir Fraser <keir.fraser@eu.citrix.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: write_tsc in a PV domain?
Date: Fri, 28 Aug 2009 10:02:05 -0700 [thread overview]
Message-ID: <4A980D8D.1060708@goop.org> (raw)
In-Reply-To: <d3c83762-a28b-4dcc-b368-e955e8fa1e7a@default>
On 08/27/09 20:29, Dan Magenheimer wrote:
>> If an app is sophisticated to do this correctly then it
>> doesn't need any
>> special assistance from a hypervisor to make the tsc well-behaved. It
>> should continue to work even in a Xen guest where both the process can
>> skip between VCPUs and the VCPUs can skip between PCPUs.
>>
> No, I don't think this is true. An enterprise app that binds processes
> to fixed physical processors on a physical machine can make
> assumptions about the results of rdtsc that aren't valid when
> the vcpus can skip between pcpus.
You can bind a vcpu to a pcpu or group of pcpus with the right tsc
properties. At this point you're talking about a specialized
non-portable app with very sensitive dependencies on the system software
and underlying hardware, so requiring some special effort to virtualize
it doesn't seem like a big problem.
> Further, like Linux itself,
> applications may test assumptions about tsc at startup that are
> assumed to remain valid for the life of the app, which is
> perfectly reasonable on a physical machine and a bad mistake
> in a virtualized environment.
>
Not really. An app can't tell whether its initial test happened to be
in a stable period that will be later upset by a power event,
suspend/resume, migration via some other mechanism (like
vserver/containers), etc, etc. An app making such assumptions will be
very machine and system dependent, and not at all portable.
> True, but any app that tries to run on a NUMA machine without
> being aware of the idiosyncracies of a NUMA machine probably
> has worse problems to deal with than tsc sync. Further, there
> are many many apps that will likely never ever run on those
> machines.
Who can say? Effects caused by locality issues will only result in
performance problems rather than outright correctness problems.
> Are we going to penalize all apps all the time
> because some might run some of the time on a machine where
> tsc is not synced?
>
They're already penalized. The population of machines with a tsc which
can be used in the manner you're suggesting is very small, and even then
there are strong caveats.
>> But in this case I'm talking specifically about a Xen PV guest, where
>> the tsc is claimed for use by the Xen clocksource ABI.
>>
> I just don't understand how you can say that a valid userland
> instruction is "claimed for use" by Xen (or Linux or both).
>
Apps are free to try and use the tsc in any way they feel like, but it
has never had any guaranteed properties. Some uses are completely
reasonable (like using it as some entropy to seed an RNG, for example).
At one point the kernel did disable the tsc for usermode use, but that
was quickly reverted (or perhaps it never made it to mainline) because
its not for the kernel to break backwards compatibility for the sake of
second-guessing usermode.
I think this is getting a bit repetitive.
J
next prev parent reply other threads:[~2009-08-28 17:02 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-25 21:54 write_tsc in a PV domain? Dan Magenheimer
2009-08-25 22:28 ` Jeremy Fitzhardinge
2009-08-25 23:09 ` Dan Magenheimer
2009-08-26 6:23 ` Keir Fraser
2009-08-26 15:42 ` Dan Magenheimer
2009-08-26 15:58 ` Keir Fraser
2009-08-26 19:45 ` Jeremy Fitzhardinge
2009-08-26 20:23 ` Dan Magenheimer
2009-08-26 22:30 ` Jeremy Fitzhardinge
2009-08-26 23:10 ` Dan Magenheimer
2009-08-27 8:39 ` Chris Lalancette
2009-08-27 13:00 ` Dan Magenheimer
2009-08-27 13:17 ` Chris Lalancette
2009-08-27 8:48 ` Alan Cox
2009-08-27 19:10 ` Jeremy Fitzhardinge
2009-08-28 3:29 ` Dan Magenheimer
2009-08-28 9:49 ` Alan Cox
2009-08-28 15:16 ` Dan Magenheimer
2009-08-28 15:30 ` Alan Cox
2009-08-28 17:49 ` rdtsc: correctness vs performance on Xen (and KVM?) Dan Magenheimer
2009-08-31 23:52 ` Dan Magenheimer
2009-09-01 0:22 ` Jeremy Fitzhardinge
2009-09-01 13:54 ` Dan Magenheimer
2009-09-01 14:34 ` Keir Fraser
2009-09-01 14:53 ` Dan Magenheimer
2009-09-01 15:08 ` Keir Fraser
2009-09-01 15:26 ` Dan Magenheimer
2009-09-01 15:32 ` Jan Beulich
2009-09-01 15:56 ` Dan Magenheimer
2009-09-01 16:04 ` Jan Beulich
2009-09-01 16:41 ` Dan Magenheimer
2009-09-02 7:05 ` Jan Beulich
2009-09-01 21:25 ` Keir Fraser
2009-09-01 22:08 ` Dan Magenheimer
2009-09-01 22:21 ` Jeremy Fitzhardinge
2009-09-01 22:41 ` Dan Magenheimer
2009-09-01 23:26 ` Jeremy Fitzhardinge
2009-09-02 7:20 ` Keir Fraser
2009-09-02 21:44 ` Jeremy Fitzhardinge
2009-09-02 21:50 ` Keir Fraser
2009-09-02 22:05 ` Jeremy Fitzhardinge
2009-09-03 8:23 ` Jan Beulich
2009-09-03 17:29 ` Jeremy Fitzhardinge
2009-09-04 7:19 ` Jan Beulich
2009-09-04 15:44 ` Jeremy Fitzhardinge
2009-09-03 14:22 ` Dan Magenheimer
2009-09-02 7:16 ` Jan Beulich
2009-09-02 7:01 ` Jan Beulich
2009-09-01 16:06 ` Keir Fraser
2009-09-01 16:55 ` Dan Magenheimer
2009-09-01 15:43 ` Keir Fraser
2009-08-28 17:49 ` write_tsc in a PV domain? Dan Magenheimer
2009-08-28 17:02 ` Jeremy Fitzhardinge [this message]
2009-08-28 17:49 ` Dan Magenheimer
2009-08-28 23:01 ` Jeremy Fitzhardinge
2009-08-29 17:51 ` Dan Magenheimer
2009-08-31 18:11 ` Dan Magenheimer
2009-08-31 19:06 ` Keir Fraser
2009-08-31 21:06 ` Dan Magenheimer
2009-09-01 7:16 ` Keir Fraser
2009-08-31 19:18 ` Jeremy Fitzhardinge
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=4A980D8D.1060708@goop.org \
--to=jeremy@goop.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dan.magenheimer@oracle.com \
--cc=keir.fraser@eu.citrix.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.