All of lore.kernel.org
 help / color / mirror / Atom feed
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>
Subject: Re: [PATCH] replace rdtsc emulation-vs-native xen boot option with per-domain (hypervisor part)
Date: Tue, 29 Sep 2009 09:44:36 -0700	[thread overview]
Message-ID: <4AC23974.1060602@goop.org> (raw)
In-Reply-To: <5f6198f2-3f74-4bdb-ad9a-d9fd6151a97f@default>

On 09/28/09 16:36, Dan Magenheimer wrote:
>> Well, it shouldn't be enabled by default.  That slows down all rdtsc
>> operations for the benefit of very niche applications.  The Xen
>> clocksource assumes that rdtsc is fast, unemulated and in need of
>> correction.
>>
>> If someone really needs an artificial tsc, then they can enable the
>> option for themselves.
>>     
> While I understand and sympathize (and the idealistic side of me even
> agrees with) your position, 
>   


Please, no.  I think you've managed to completely misunderstand
everything I've said on this subject.

The TSC is not, and has never been reliable.  At best it has periods of
reliability in which its possible to get coherent results, but never for
indefinite periods.  That includes the recent architecture updates,
though they have considerably increased the periods of reliability. 
This is not an idealistic statement; it is the conclusion from years of
attempts to use the tsc as a time source.  It does not matter what the
documents say, there's always a creative new way for hardware to break
the tsc's behaviour.

There is no requirement for Xen to emulate a hardware feature better
than native.  In particular, there's no need for Xen to synthesize the
platonic ideal of a TSC when existing hardware platform does not do so.

That said, I have no problem with making such emulation an option if it
really helps real programs in the field.  I wouldn't even mind having it
on by default...

Except that it comes with a terrible cost.  rdtsc is a very heavily used
instruction, because its part of the Xen clock ABI.  It gets executed
many thousands of times a second, including at least once every context
switch.  Adding the overhead of an extra synchronous emulated
instruction trap into Xen is going to have a very noticeable performance
hit.

This is a massive regression in everyday, every-system, every-user
performance to satisfy the hypothetical requirement of abstract apps
which may or may not exist.

The fact that you haven't named a single real app that breaks in the
current system and then works with a synthetic TSC further undermines
your argument.  Are you really arguing on the basis that "some apps
might use tsc in a fragile way" or do you actually have a specific list
of apps that are really suffering?  What are they?  How do they break? 
How many users do they have?  What are they doing with the tsc?  Why
can't they use some other mechanism?

I think a change of this magnitude needs a lot more justification than
some handwavy arguments from (dubious) first principles.

    J

  parent reply	other threads:[~2009-09-29 16:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-27 19:22 [PATCH] replace rdtsc emulation-vs-native xen boot option with per-domain (hypervisor part) Dan Magenheimer
2009-09-27 21:39 ` Keir Fraser
2009-09-27 23:19   ` Dan Magenheimer
2009-09-28  7:25     ` Keir Fraser
2009-09-28  9:04       ` Keir Fraser
2009-09-28 15:48         ` Dan Magenheimer
2009-09-28 16:07           ` Keir Fraser
2009-09-28 16:24             ` Dan Magenheimer
2009-09-28 19:44               ` Dan Magenheimer
2009-09-28 20:55                 ` Keir Fraser
2009-09-28  8:22     ` Zhang, Xiantao
2009-09-28 15:13       ` Dan Magenheimer
2009-09-28 22:24 ` Jeremy Fitzhardinge
2009-09-28 22:43   ` Dan Magenheimer
2009-09-28 23:10     ` Jeremy Fitzhardinge
2009-09-28 23:36       ` Dan Magenheimer
2009-09-29  0:27         ` Ian Pratt
2009-09-29  1:42           ` Zhang, Xiantao
2009-09-29  3:13             ` Dan Magenheimer
2009-09-29 17:24               ` Jeremy Fitzhardinge
2009-09-29 16:44         ` Jeremy Fitzhardinge [this message]
2009-09-29 17:34           ` Dan Magenheimer
2009-09-29 19:01             ` Jeremy Fitzhardinge
2009-09-29 23:45               ` Dan Magenheimer
2009-09-30  0:41                 ` Jeremy Fitzhardinge
2009-10-05 23:15 ` Jeremy Fitzhardinge
2009-10-05 23:42   ` Dan Magenheimer
2009-10-06  0:20     ` Jeremy Fitzhardinge
2009-10-06  1:43       ` Dan Magenheimer
2009-10-06  4:56         ` Jeremy Fitzhardinge
2009-10-06  7:07         ` Keir Fraser
2009-10-06  9:09           ` Keir Fraser
2009-10-06 13:49             ` Dan Magenheimer
2009-10-06 13:59               ` Keir Fraser
2009-10-08 23:35                 ` Dan Magenheimer
2009-11-05 17:08                 ` Dan Magenheimer
2009-11-06  7:01                   ` Keir Fraser

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=4AC23974.1060602@goop.org \
    --to=jeremy@goop.org \
    --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.