Skip to contentSkip to conversation

Clock off in guest

DISCUSSION Koen Vermeer 3 participants 3 messages Feb 13, 2008 KVM

lore
Share & tools
lore
#0 lore raw

Hi,

I'm running an Linux AMD64 guest on an AMD64 host. The host is running a 2.6.23 kernel (self compiled), the guest is running a stock linux-image-2.6.22-3-amd64 Debian kernel.

My problem is that the clock on the guest is off (slow), while the clock on the host seems to be OK. When doing 'time sleep 10' on the guest, it takes about 16 'real' seconds for it to finish.

I can change the host kernel, the guest kernel or fiddle around with kvm command line options, but I would like some guidance where to start. Which option has the largest probability of solving my problem? Let me know if you need some dmesg output or some other log data; I didn't want to flood the list with random logs of both the host and the guest.

Best,
Koen

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

#1 lore raw
Quoted 9 lines · Koen Vermeer

Hi,

I'm running an Linux AMD64 guest on an AMD64 host. The host is running a 2.6.23 kernel (self compiled), the guest is running a stock linux-image-2.6.22-3-amd64 Debian kernel.

My problem is that the clock on the guest is off (slow), while the clock on the host seems to be OK. When doing 'time sleep 10' on the guest, it takes about 16 'real' seconds for it to finish.

What is the clock source of your guest? If it is the traditional PIT, you describe a known problem in busy hosts. You may try to set clocksource=tsc in the guest kerenl parameters.

Regards,

Dan.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

#2 lore raw

From: [email protected] on behalf of Dan Kenigsberg
Sent: Wed 13/02/2008 13:25
To: Koen Vermeer
Cc: [email protected]
Subject: Re: [kvm-devel] Clock off in guest

Quoted 11 lines · Koen Vermeer
Quoted 9 lines

Hi,

I'm running an Linux AMD64 guest on an AMD64 host. The host is running a 2.6.23 kernel (self compiled), the guest is running a stock linux-image-2.6.22-3-amd64 Debian kernel.

My problem is that the clock on the guest is off (slow), while the clock on the host seems to be OK. When doing 'time sleep 10' on the guest, it takes about 16 'real' seconds for it to finish.

Quoted 7 lines

What is the clock source of your guest? If it is the traditional PIT, you describe a known problem in busy hosts. You may try to set clocksource=tsc in the guest kerenl parameters.

Regards,

Dan.

Hi,

This would not work if you are using an old version of kvm ( with no in-kernel-apic )
I recommend upgrading to kvm-60 (or latest linux kernel).
Or as an alternative, probably not as good, sometimes (when the guest's clocksource is PIT) adding '-tdf' to the command line helps.

Uri.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel