From: "David S. Ahern" <daahern@cisco.com>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: kvm-devel <kvm@vger.kernel.org>,
Marcelo Tosatti <mtosatti@redhat.com>,
Glauber de Oliveira Costa <gcosta@redhat.com>,
Avi Kivity <avi@redhat.com>
Subject: Re: gettimeofday "slow" in RHEL4 guests
Date: Tue, 25 Nov 2008 12:09:34 -0700 [thread overview]
Message-ID: <492C4D6E.3050005@cisco.com> (raw)
In-Reply-To: <1227633606.7434.14.camel@localhost.localdomain>
Hollis Blanchard wrote:
> On Mon, 2008-11-24 at 21:41 -0700, David S. Ahern wrote:
>> RHEL3 (which is based on the 2.4.21 kernel) gets microsecond
>> resolutions
>> by reading the TSC. Reading the TSC from within a guest is very fast
>> on kvm.
>>
>> RHEL4 (which is basd on the 2.6.9 kernel) allows multiple time
>> sources:
>> pmtmr (ACPI power management timer which is the default), pit, hpet
>> and TSC.
>>
>> The pmtmr and pit both do ioport reads to get microsecond resolutions
>> (see read_pmtmr and get_offset_pit, respectively). For the tsc as the
>> timer source gettimeofday is *very* lightweight, but time drifts very
>> badly and ntpd cannot acquire a sync.
>
> Why aren't you seeing severe time drift when using RHEL3 guests with the
> TSC time source?
>
With RHEL3 it's a PIT time source, and the PIT counter is only read on
interrupts. For gettimeofday requests only the tsc is read; the
algorithm for microsecond resolution uses the pit count and its tsc
timestamp from the last interrupt.
In RHEL4, the PIT counter is read for each gettimeofday request when it
is the timer source. That's the cause of the extra overhead, and
consequently, worse performance.
david
prev parent reply other threads:[~2008-11-25 19:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 17:47 gettimeofday "slow" in RHEL4 guests David S. Ahern
2008-11-25 4:41 ` David S. Ahern
2008-11-25 10:14 ` Andi Kleen
2008-11-25 11:17 ` Alexander Graf
2008-11-25 11:48 ` Andi Kleen
2008-11-25 12:13 ` Alexander Graf
2008-11-25 12:52 ` Andi Kleen
2008-12-28 18:38 ` Marcelo Tosatti
2008-12-29 12:37 ` Yang, Sheng
2008-12-29 13:11 ` Avi Kivity
2008-12-29 16:12 ` Dor Laor
2008-12-29 16:27 ` Avi Kivity
2008-12-29 16:29 ` Avi Kivity
2008-11-25 17:20 ` Hollis Blanchard
2008-11-25 19:09 ` David S. Ahern [this message]
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=492C4D6E.3050005@cisco.com \
--to=daahern@cisco.com \
--cc=avi@redhat.com \
--cc=gcosta@redhat.com \
--cc=hollisb@us.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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.