From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer
Date: Tue, 23 Aug 2011 14:44:05 +0200 [thread overview]
Message-ID: <4E53A095.6040002@redhat.com> (raw)
In-Reply-To: <4E539E2C.7090407@us.ibm.com>
On 08/23/2011 02:33 PM, Anthony Liguori wrote:
>> cpu_get_ticks is used also to emulate the guest TSC, are you sure you
>> want to change that uniformly to a 1 GHz rate?
>
> Where possible, CLOCK_MONOTONIC_RAW should be implemented in terms or
> rdtscp. It will provide the highest accuracy time source that you can get.
Not all machines have rdtscp. People do not want to see their rdtsc
suddenly 20 times slower or so (that's more or less the speed difference
between HPET access and rdtsc). Many also would likely be surprised to
see a guest TSC that is 1 GHz. Xen did the same at some point, and
backed it out.
And you're not using CLOCK_MONOTONIC_RAW anyway (yet?). If you used it,
you should also change the CPUID features since QEMU would be providing
a constant, invariant TSC to all guests.
> So I don't think there's any different in terms of timer granularity
> from using CLOCK_MONOTONIC_RAW and rdtsc directly other than the former
> is more correct.
CLOCK_MONOTONIC_RAW has its resolution capped to 1 ns. It is as correct
and as precise, but less accurate than the TSC if your machine's TSC is
constant and invariant.
Paolo
next prev parent reply other threads:[~2011-08-23 12:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 19:21 [Qemu-devel] [PATCH 1/2] main: add high resolution GSource based timer Anthony Liguori
2011-08-22 19:21 ` [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer Anthony Liguori
2011-08-22 20:28 ` Jan Kiszka
2011-08-22 20:36 ` Anthony Liguori
2011-08-22 20:49 ` Jan Kiszka
2011-08-22 21:55 ` Anthony Liguori
2011-08-22 23:48 ` Jan Kiszka
2011-08-23 8:12 ` Paolo Bonzini
2011-08-23 9:07 ` Edgar E. Iglesias
2011-08-23 7:43 ` Paolo Bonzini
2011-08-23 12:33 ` Anthony Liguori
2011-08-23 12:44 ` Paolo Bonzini [this message]
2011-08-22 19:26 ` [Qemu-devel] [PATCH 1/2] main: add high resolution GSource based timer Anthony Liguori
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=4E53A095.6040002@redhat.com \
--to=pbonzini@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).