From: Marshal Newrock <marshal@freedombi.com>
To: kvm@vger.kernel.org
Subject: clock in kvm guests
Date: Thu, 4 Sep 2008 10:52:27 -0400 [thread overview]
Message-ID: <20080904105227.348e39cd@osiris> (raw)
[-- Attachment #1: Type: text/plain, Size: 2475 bytes --]
This started because I have a host running Ubuntu 8.04 x86_64 with
kvm-69, and I noticed the guests on it tended to lose about a minute a
day as compared to the host. The guests are also running Ubuntu 8.04.
I had tried booting with clocksource=acpi_pm, but that seemed to make
it worse. Unfortunately, I don't have specific numbers on this.
There is also a FreeBSD guest on that server, which has been up for
over 13 days, and only lost 2 seconds.
When another server became available, with the same CPU as the first, I
first tried kvm-62, from the standard Ubuntu packages, with a single
guest sitting idle. I compared clock rates by running "watch -n 1
uptime" on host and guest simultaneously.
After 13 hours, the guest was behind by 15 seconds. So, I installed
kvm-74. With this, after 15 hours, the guest was behind by about 4-6
seconds. I added the kernel parameter "clocksource=acpi_pm" to the
guest, and shut it down and restarted it (to reset the clock). With
this, the times seemed closely kept in sync. There seemed to be a
fluctuation of up to 2 seconds, though it was usually +/-1. With the
"watch" mentioned above, the guest occasionally seemed to skip a second
to catch up. At this time, after approximately 2 days, the guest is
actually ahead of the host by 1-2 seconds.
As a workaround on the kvm-69 guests, I have added "hwclock --hctosys"
to crontab on the guests. With the clock improvements I see in kvm-74,
this isn't an issue for me. But for now, I do have the new machine
available for testing, if needed.
first processor from /proc/cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(TM) CPU 2.66GHz
stepping : 4
cpu MHz : 2659.998
cache size : 2048 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx lm constant_tsc pebs bts sync_rdtsc pni monitor ds_cpl vmx
est cid cx16 xtpr lahf_lm bogomips : 5324.08 clflush size :
64 cache_alignment : 128
address sizes : 36 bits physical, 48 bits virtual
power management:
--
Marshal Newrock
FreedomBI, LLC - http://www.freedombi.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
reply other threads:[~2008-09-04 15:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080904105227.348e39cd@osiris \
--to=marshal@freedombi.com \
--cc=kvm@vger.kernel.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