From: Zachary Amsden <zach@vmware.com>
To: Glauber de Oliveira Costa <gcosta@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, tglx@linutronix.de,
rusty@rustcorp.com.au, jeremy@goop.org, --cc@redhat.com,
avi@quramnet.com, kvm-devel@lists.sourceforge.net,
Glauber de Oliveira Costa <glauber@t60.localdomain>,
Dan Hecht <dhecht@vmware.com>, Garrett Smith <garrett@vmware.com>
Subject: Re: [PATCH] raise tsc clocksource rating
Date: Tue, 30 Oct 2007 10:58:50 -0700 [thread overview]
Message-ID: <1193767130.9793.119.camel@bodhitayantram.eng.vmware.com> (raw)
In-Reply-To: <47271D4A.8030707@redhat.com>
On Tue, 2007-10-30 at 10:02 -0200, Glauber de Oliveira Costa wrote:
> > No, if no paravirt clocksource is detected, nothing can override the
> > perfect TSC hardware clocksource rating of 400. And if a paravirt
> > clocksource is detected, it is always better than TSC.
>
> Why always? tsc is the best possible alternative the _platform_ can
> provide. So the paravirt clocksource will be at best, as good as tsc.
What is the justification for this claim? The TSC provides no
information about frequency. The frequency must be measured from a
known fixed rate source. This measurement is error prone, both on real
hardware, and even more so in a VM.
The TSC can only provide a single measure of elapsed periods. It has no
concept to differentiate between elapsed periods of time spent in the
guest, which is relevant to the scheduler, and elapsed periods of time
spent in real time, which is relevant to timekeeping.
So a TSC can not drive both timekeeping and scheduling in a virtual
machine, or if it does, it does so inaccurately.
> And if it is the case: why bother with communication mechanisms of all
> kinds, calculations, etc, if we can just read the tsc?
>
> Noting again: If the tsc does not arrive accurate to the guest, it will
> fail the tsc clocksource tests. So it will be rated zero anyway
You always need to provide a TSC, and it will always initially appear to
be accurate. Long term, as time is reported via the TSC is an
approximation somewhere between real time and elapsed running time,
measurements made using it in a VM will drift, and it is impossible to
remove the inaccuracy from one end of the spectrum (by providing real
time exactly) without compromising it at the other end (by skewing
relative time measurement).
A paravirt clocksource is always better than a TSC because it
compensates for these effects.
Zach
next prev parent reply other threads:[~2007-10-30 17:58 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-29 23:10 Glauber de Oliveira Costa
2007-10-29 22:17 ` Thomas Gleixner
2007-10-29 22:36 ` Ingo Molnar
2007-10-30 1:26 ` john stultz
2007-10-30 2:39 ` Rusty Russell
2007-10-30 7:37 ` Ingo Molnar
2007-10-30 10:52 ` Rusty Russell
2007-10-30 12:13 ` Glauber de Oliveira Costa
2007-10-29 22:42 ` Zachary Amsden
2007-10-29 22:45 ` Jeremy Fitzhardinge
2007-10-29 22:48 ` Ingo Molnar
2007-10-29 22:52 ` Jeremy Fitzhardinge
2007-10-29 22:55 ` Ingo Molnar
2007-10-29 23:17 ` Jeremy Fitzhardinge
2007-10-29 23:21 ` Ingo Molnar
2007-10-29 23:33 ` Jeremy Fitzhardinge
2007-10-30 0:45 ` Ian Pratt
2007-10-30 7:19 ` Ingo Molnar
2007-10-29 22:55 ` Zachary Amsden
2007-10-29 23:02 ` Ingo Molnar
2007-10-29 23:13 ` Zachary Amsden
2007-10-29 23:17 ` Ingo Molnar
2007-10-30 12:02 ` Glauber de Oliveira Costa
2007-10-30 17:58 ` Zachary Amsden [this message]
2007-10-29 23:24 ` Dan Hecht
2007-10-30 4:24 ` [kvm-devel] " Avi Kivity
2007-10-30 7:14 ` Ingo Molnar
2007-10-30 11:59 ` Glauber de Oliveira Costa
2007-10-30 0:17 ` H. Peter Anvin
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=1193767130.9793.119.camel@bodhitayantram.eng.vmware.com \
--to=zach@vmware.com \
--cc=--cc@redhat.com \
--cc=avi@quramnet.com \
--cc=dhecht@vmware.com \
--cc=garrett@vmware.com \
--cc=gcosta@redhat.com \
--cc=glauber@t60.localdomain \
--cc=jeremy@goop.org \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®