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 12:01:46 -0700	[thread overview]
Message-ID: <4AC2599A.9040300@goop.org> (raw)
In-Reply-To: <6fc67e4a-e491-40f2-8c88-083fc5c15aa6@default>

On 09/29/09 10:34, Dan Magenheimer wrote:
>> The TSC is not, and has never been reliable.
>>     
> Your data is stale.  Please discuss this with processor
> and system vendors (I have)

I'm sure they would say that, as they frequently have in the past.  And
then it breaks again.

Even then their guarantee only applies while the processor is powered up
and hasn't been reset.  But resets can occur while the system is
"running" in the form of S3 suspend events, or even completely powered
off when suspending to disk.

Besides, the SDM makes no claims about tsc synchronization between CPUs,
only that on a given CPU/core is at a constant rate (at least from now
on, promise!).  At that point you're relying on motherboard/system
design, which has a lot more scope for brokenness than just core CPUs. 
Large systems simply don't keep all their CPUs in the same clock domain,
and certainly won't guarantee that for all future system designs.

>  and look at the latest upstream Linux.
>   
The kernel does what it needs to do to make the tsc usable for itself. 
It does not make (and has never made) any guarantees about how the tsc
appears in usermode (except for the purposes of implementing
vgettimeofday).  You won't find many Linux kernel developers who are
sympathetic with the idea of making any hard guarantees for bare
usermode tsc use.

>> Except that it comes with a terrible cost...
>> This is a massive regression...
>>     
> It is certainly significant but "terrible" and "massive"
> are a bit strong.  Based on my measurements, the examples
> you cite will degrade performance by a fraction of a percent.
>   
How have you measured this?  On what systems?  Your patch introduces
this regression on all systems for everyone; it isn't enough to measure
it on a new Nehalem machine.

>> The fact that you haven't named a single real app...
>> 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
>>     
> I have a (small) specific list.  For various reasons,
> I cannot go into further detail.
>   

Well, that goes back to my point about spending a lot of effort on
something that can only possibility benefit a (small) set of niche
apps.  Spending the effort on a vsyscall approach would be fast, correct
and widely beneficial.

You can default it on within Oracle, or even in Oracle's Xen distro. 
It's unreasonable to make this a global default when you're trying to
solve a local problem.  You haven't established this is something that
anyone else need be concerned about.

Besides, if they want a global sequence number, why not just keep a
global counter?  That's going to be much cheaper and more reliable than
anything time-based.

    J

  reply	other threads:[~2009-09-29 19:01 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
2009-09-29 17:34           ` Dan Magenheimer
2009-09-29 19:01             ` Jeremy Fitzhardinge [this message]
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=4AC2599A.9040300@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.