* keeping time
@ 2007-12-26 14:35 Yves Dorfsman
2007-12-26 14:39 ` Izik Eidus
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Yves Dorfsman @ 2007-12-26 14:35 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
What is the recommended way to keep the time correct on a UNIX KVM machine ?
I am using Linux x86_64 (gentoo) both as a host and as a guest, and can't
keep the time straight on the guest. Ntpd eventually gives up because the
clock is too wanky.
I run into this problem both with versions 28 and 57.
Thanks.
Yves.
PS: I realize this is for kvm developers, but could not find a KVM user
list - please point me towards the apropriate list if this is the wrong
choice.
----
Yves Dorfsman yves-Qq95MN99UUsAvxtiuMwx3w@public.gmane.org
http://www.SollerS.ca
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
2007-12-26 14:35 keeping time Yves Dorfsman
@ 2007-12-26 14:39 ` Izik Eidus
2007-12-26 14:51 ` Avi Kivity
2007-12-27 2:28 ` Yang, Sheng
2 siblings, 0 replies; 10+ messages in thread
From: Izik Eidus @ 2007-12-26 14:39 UTC (permalink / raw)
To: Yves Dorfsman; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Yves Dorfsman wrote:
> What is the recommended way to keep the time correct on a UNIX KVM machine ?
>
what happen when you try:
-no-kvm-irqchip -tdf ?
(you arent runing it with -no-kvm-irqchip right now right?, if you dont
it is probably bug)
> I am using Linux x86_64 (gentoo) both as a host and as a guest, and can't
> keep the time straight on the guest. Ntpd eventually gives up because the
> clock is too wanky.
>
> I run into this problem both with versions 28 and 57.
>
> Thanks.
>
>
> Yves.
>
> PS: I realize this is for kvm developers, but could not find a KVM user
> list - please point me towards the apropriate list if this is the wrong
> choice.
> ----
> Yves Dorfsman yves-Qq95MN99UUsAvxtiuMwx3w@public.gmane.org
> http://www.SollerS.ca
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
2007-12-26 14:35 keeping time Yves Dorfsman
2007-12-26 14:39 ` Izik Eidus
@ 2007-12-26 14:51 ` Avi Kivity
[not found] ` <47726A7D.1010103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-27 2:28 ` Yang, Sheng
2 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2007-12-26 14:51 UTC (permalink / raw)
To: Yves Dorfsman; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Yves Dorfsman wrote:
> What is the recommended way to keep the time correct on a UNIX KVM machine ?
>
> I am using Linux x86_64 (gentoo) both as a host and as a guest, and can't
> keep the time straight on the guest. Ntpd eventually gives up because the
> clock is too wanky.
>
>
ntp is too clever for virtual machines. What happens if you don't
enable it?
Please provide the guest's /proc/interrupts.
>
> PS: I realize this is for kvm developers, but could not find a KVM user
> list - please point me towards the apropriate list if this is the wrong
> choice.
>
This is the right place to report bugs.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
2007-12-26 17:13 ` Yves Dorfsman
@ 2007-12-26 17:10 ` Izik Eidus
[not found] ` <47728B01.1090603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Izik Eidus @ 2007-12-26 17:10 UTC (permalink / raw)
To: Yves Dorfsman; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Yves Dorfsman wrote:
> On Wed, 26 Dec 2007, Avi Kivity wrote:
>
>
>> ntp is too clever for virtual machines. What happens if you don't enable it?
>>
>
> Same thing.
>
>
>> Please provide the guest's /proc/interrupts.
>>
>
> more /proc/interrupts
> CPU0
> 0: 27066 XT-PIC-XT timer
> 1: 9 XT-PIC-XT i8042
> 2: 0 XT-PIC-XT cascade
> 8: 0 XT-PIC-XT rtc
> 11: 393 XT-PIC-XT eth0
> 12: 110 XT-PIC-XT i8042
> 14: 1670 XT-PIC-XT ide0
> 15: 48 XT-PIC-XT ide1
> NMI: 0
> LOC: 18300
> ERR: 0
>
> This is with "-no-kvm-irqchip -tdf" which made no difference.
>
ohhh i forgat to mention to boot the linux without apic when you run the
-tdf (if i remember it is noapic)
but there is still bug here....
> Now, because of my mother board, I have to start linux with "acpi=off",
> could that be a problem ?
>
> Yves.
> ----
> Yves Dorfsman yves-Qq95MN99UUsAvxtiuMwx3w@public.gmane.org
> http://www.SollerS.ca
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
[not found] ` <47726A7D.1010103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-12-26 17:13 ` Yves Dorfsman
2007-12-26 17:10 ` Izik Eidus
0 siblings, 1 reply; 10+ messages in thread
From: Yves Dorfsman @ 2007-12-26 17:13 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Wed, 26 Dec 2007, Avi Kivity wrote:
> ntp is too clever for virtual machines. What happens if you don't enable it?
Same thing.
>
> Please provide the guest's /proc/interrupts.
more /proc/interrupts
CPU0
0: 27066 XT-PIC-XT timer
1: 9 XT-PIC-XT i8042
2: 0 XT-PIC-XT cascade
8: 0 XT-PIC-XT rtc
11: 393 XT-PIC-XT eth0
12: 110 XT-PIC-XT i8042
14: 1670 XT-PIC-XT ide0
15: 48 XT-PIC-XT ide1
NMI: 0
LOC: 18300
ERR: 0
This is with "-no-kvm-irqchip -tdf" which made no difference.
Now, because of my mother board, I have to start linux with "acpi=off",
could that be a problem ?
Yves.
----
Yves Dorfsman yves-Qq95MN99UUsAvxtiuMwx3w@public.gmane.org
http://www.SollerS.ca
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
[not found] ` <47728B01.1090603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-12-26 17:51 ` Yves Dorfsman
0 siblings, 0 replies; 10+ messages in thread
From: Yves Dorfsman @ 2007-12-26 17:51 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Wed, 26 Dec 2007, Izik Eidus wrote:
> ohhh i forgat to mention to boot the linux without apic when you run the -tdf
> (if i remember it is noapic)
Yes I verified, "noapic". Now that's weird.... the clock is a little bit
fast (as opposed to very slow previously). It got 7 second too fast, in
about 10 minutes/
I think this is something ntpd could cope with. Can/should I run ntpd on a
kvm vm, or not ? Is there a consensus on this ?
Since the host runs on time, is there anyway to tell kvm to just use the
host clock ?
Yves.
----
Yves Dorfsman yves-Qq95MN99UUsAvxtiuMwx3w@public.gmane.org
http://www.SollerS.ca
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
2007-12-26 14:35 keeping time Yves Dorfsman
2007-12-26 14:39 ` Izik Eidus
2007-12-26 14:51 ` Avi Kivity
@ 2007-12-27 2:28 ` Yang, Sheng
[not found] ` <200712271028.52234.sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2 siblings, 1 reply; 10+ messages in thread
From: Yang, Sheng @ 2007-12-27 2:28 UTC (permalink / raw)
To: Yves Dorfsman; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Wednesday 26 December 2007 22:35:29 Yves Dorfsman wrote:
> What is the recommended way to keep the time correct on a UNIX KVM machine
> ?
>
> I am using Linux x86_64 (gentoo) both as a host and as a guest, and can't
> keep the time straight on the guest. Ntpd eventually gives up because the
> clock is too wanky.
What's your guest kernel version?
When I debug my in kernel PIT(not sent yet, though kept for months), I found
the kernel version have something to do with the timer accuracy. On my
limited test, the kernel 2.6.18, 2.6.20, 2.6.22 with default kernel
parameters works well with my PIT patch. But for kernel 2.6.9, I have to
use "clock=pit", otherwise the timer is much faster.
And for current KVM, I found 2.6.18 is very slow compared to host. 2.6.20 is
about 1/3 slow. (host: 30s, guest: 40s, using "sleep"), and 2.6.22 is OK.
>
> I run into this problem both with versions 28 and 57.
>
> Thanks.
>
>
> Yves.
>
> PS: I realize this is for kvm developers, but could not find a KVM user
> list - please point me towards the apropriate list if this is the wrong
> choice.
> ----
> Yves Dorfsman yves-Qq95MN99UUsAvxtiuMwx3w@public.gmane.org
> http://www.SollerS.ca
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
--
Thanks
Yang, Sheng
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
[not found] ` <200712271028.52234.sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2007-12-27 6:51 ` Yves Dorfsman
2007-12-27 7:05 ` Yang, Sheng
2007-12-27 7:19 ` Dong, Eddie
1 sibling, 1 reply; 10+ messages in thread
From: Yves Dorfsman @ 2007-12-27 6:51 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Thu, 27 Dec 2007, Yang, Sheng wrote:
> What's your guest kernel version?
2.6.22
> When I debug my in kernel PIT(not sent yet, though kept for months), I found
> the kernel version have something to do with the timer accuracy. On my
> limited test, the kernel 2.6.18, 2.6.20, 2.6.22 with default kernel
> parameters works well with my PIT patch. But for kernel 2.6.9, I have to
> use "clock=pit", otherwise the timer is much faster.
I have added clock=pit, but it does not help. Do you need a specific patch
for this, or do all kernels accept it ?
Yves.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
2007-12-27 6:51 ` Yves Dorfsman
@ 2007-12-27 7:05 ` Yang, Sheng
0 siblings, 0 replies; 10+ messages in thread
From: Yang, Sheng @ 2007-12-27 7:05 UTC (permalink / raw)
To: Yves Dorfsman; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Thursday 27 December 2007 14:51:06 Yves Dorfsman wrote:
> On Thu, 27 Dec 2007, Yang, Sheng wrote:
> > What's your guest kernel version?
>
> 2.6.22
>
> > When I debug my in kernel PIT(not sent yet, though kept for months), I
> > found the kernel version have something to do with the timer accuracy. On
> > my limited test, the kernel 2.6.18, 2.6.20, 2.6.22 with default kernel
> > parameters works well with my PIT patch. But for kernel 2.6.9, I have to
> > use "clock=pit", otherwise the timer is much faster.
>
> I have added clock=pit, but it does not help. Do you need a specific patch
> for this, or do all kernels accept it ?
Oh, this is a kernel parameter, but currently:
1. The latest kernel using "clocksource=" instead of "clock=". You can check
the Documentation/kernel-parameters.txt
2. I haven't sent out the in-kernel PIT patch... At present, KVM still using
PIT from userspace/QEMU.
I guesses you are under heavy workload? For "sleep" in bash seems ok on 2.6.22
(x86_64, using RHEL5 as guest distro).
>
>
> Yves.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
--
Thanks
Yang, Sheng
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: keeping time
[not found] ` <200712271028.52234.sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2007-12-27 6:51 ` Yves Dorfsman
@ 2007-12-27 7:19 ` Dong, Eddie
1 sibling, 0 replies; 10+ messages in thread
From: Dong, Eddie @ 2007-12-27 7:19 UTC (permalink / raw)
To: Yang, Sheng, Yves Dorfsman; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1: Type: text/plain, Size: 3200 bytes --]
Using PIT to get guest timer faster is a known issue for unmodified Linux of early version such as 2.6.9.
that is why we introduced some extra complicated logic in Xen to try to fix it but not perfect.
pv timer should fix this in future, and ntpd is also a good way.
BTW, Yves's case, can u check more on APIC case? Specifically
I want to know how guest TSC is calibrated? How APIC timer IRQ
is delivered after a specific duration. (cat /proc/interrupts before & after sleep 10s).
thx,eddie
>-----Original Message-----
>From: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>[mailto:kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
>Yang, Sheng
>Sent: 2007年12月27日 10:29
>To: Yves Dorfsman
>Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>Subject: Re: [kvm-devel] keeping time
>
>On Wednesday 26 December 2007 22:35:29 Yves Dorfsman wrote:
>> What is the recommended way to keep the time correct on a
>UNIX KVM machine
>> ?
>>
>> I am using Linux x86_64 (gentoo) both as a host and as a
>guest, and can't
>> keep the time straight on the guest. Ntpd eventually gives
>up because the
>> clock is too wanky.
>
>What's your guest kernel version?
>
>When I debug my in kernel PIT(not sent yet, though kept for
>months), I found
>the kernel version have something to do with the timer accuracy. On my
>limited test, the kernel 2.6.18, 2.6.20, 2.6.22 with default kernel
>parameters works well with my PIT patch. But for kernel 2.6.9,
>I have to
>use "clock=pit", otherwise the timer is much faster.
>
>And for current KVM, I found 2.6.18 is very slow compared to
>host. 2.6.20 is
>about 1/3 slow. (host: 30s, guest: 40s, using "sleep"), and
>2.6.22 is OK.
>
>>
>> I run into this problem both with versions 28 and 57.
>>
>> Thanks.
>>
>>
>> Yves.
>>
>> PS: I realize this is for kvm developers, but could not find
>a KVM user
>> list - please point me towards the apropriate list if this
>is the wrong
>> choice.
>> ----
>> Yves Dorfsman
>yves-Qq95MN99UUsAvxtiuMwx3w@public.gmane.org
>>
>http://www.SollerS.ca
>>
>>
>>
>---------------------------------------------------------------
>----------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> kvm-devel mailing list
>> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>
>
>--
>Thanks
>Yang, Sheng
>
>---------------------------------------------------------------
>----------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2005.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>kvm-devel mailing list
>kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
[-- Attachment #2: Type: text/plain, Size: 228 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #3: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-12-27 7:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-26 14:35 keeping time Yves Dorfsman
2007-12-26 14:39 ` Izik Eidus
2007-12-26 14:51 ` Avi Kivity
[not found] ` <47726A7D.1010103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-26 17:13 ` Yves Dorfsman
2007-12-26 17:10 ` Izik Eidus
[not found] ` <47728B01.1090603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-26 17:51 ` Yves Dorfsman
2007-12-27 2:28 ` Yang, Sheng
[not found] ` <200712271028.52234.sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2007-12-27 6:51 ` Yves Dorfsman
2007-12-27 7:05 ` Yang, Sheng
2007-12-27 7:19 ` Dong, Eddie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox