public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PROBLEM] Guest with SMP >=2 with kvm_clock has jumping clock every few seconds
@ 2010-04-12 18:20 John Buswell
  2010-04-14 15:00 ` John Buswell
  0 siblings, 1 reply; 2+ messages in thread
From: John Buswell @ 2010-04-12 18:20 UTC (permalink / raw)
  To: kvm

I ran into the problem below running 2.6.33.2:

Problem: KVM guest running Linux 2.6.33.2 with kvm_clock as the clock 
source and more than 1 virtual CPU has the clock jumping forward 1 hour, 
13 minutes and 17 seconds (consistently)

Hardware: AMD Athlon Dual Core 4850e @ 2511.769 MHz

I can reproduce this consistently, and it does not happen on the same 
machine if I launch the same KVM guest with -smp 1.

With RTC compiled into the kernel you can see that its just clock, the 
localtime was set to UTC:

Running the following in a loop:

cat /sys/class/rtc/rtc0/time ; date

You see:

18:07:49
Mon Apr 12 18:07:49 UTC 2010

18:08:21
Mon Apr 12 19:21:49 UTC 2010

18:08:21
Mon Apr 12 18:08:22 UTC 2010

The load average on the system is 0, the guest is doing nothing but 
running init. It happens regardless of whether I run one guest or over 
10 guests on the same system.

I can easily reproduce this issue, so if you need someone to test 
patches etc, I can easily do that.

Thanks

-- 
John Buswell
http://www.carbonmountain.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PROBLEM] Guest with SMP >=2 with kvm_clock has jumping clock every few seconds
  2010-04-12 18:20 [PROBLEM] Guest with SMP >=2 with kvm_clock has jumping clock every few seconds John Buswell
@ 2010-04-14 15:00 ` John Buswell
  0 siblings, 0 replies; 2+ messages in thread
From: John Buswell @ 2010-04-14 15:00 UTC (permalink / raw)
  To: kvm

Just a follow up on this. The hypervisor had ACPI / ACPI PM clocksource 
support disabled, as did the guest. This problem occurred with both tsc 
and jiffies clock sources on the hypervisor.

With ACPI enabled and ACPI PM enabled, the clocksources on the 
hypervisor became hpt and acpi_pm. The guests still using kvm-clock, the 
clocks come up wrong. But if you set them via rtc0 (hwclock -s), they 
seem to maintain time ok. Only the first VM that came up exhibited an 
incorrect uptime.

It looks like kvm-clock overrides the setting under RTC -> Set System 
time from RTC on startup and resume. It might be a good idea to have the 
guest kernel prefer the RTC setting since its likely to correct.

Thanks

John Buswell wrote:
> I ran into the problem below running 2.6.33.2:
>
> Problem: KVM guest running Linux 2.6.33.2 with kvm_clock as the clock 
> source and more than 1 virtual CPU has the clock jumping forward 1 
> hour, 13 minutes and 17 seconds (consistently)
>
> Hardware: AMD Athlon Dual Core 4850e @ 2511.769 MHz
>
> I can reproduce this consistently, and it does not happen on the same 
> machine if I launch the same KVM guest with -smp 1.
>
> With RTC compiled into the kernel you can see that its just clock, the 
> localtime was set to UTC:
>
> Running the following in a loop:
>
> cat /sys/class/rtc/rtc0/time ; date
>
> You see:
>
> 18:07:49
> Mon Apr 12 18:07:49 UTC 2010
>
> 18:08:21
> Mon Apr 12 19:21:49 UTC 2010
>
> 18:08:21
> Mon Apr 12 18:08:22 UTC 2010
>
> The load average on the system is 0, the guest is doing nothing but 
> running init. It happens regardless of whether I run one guest or over 
> 10 guests on the same system.
>
> I can easily reproduce this issue, so if you need someone to test 
> patches etc, I can easily do that.
>
> Thanks
>


-- 
John Buswell
CEO, Carbon Mountain LLC
http://www.carbonmountain.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-14 15:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-12 18:20 [PROBLEM] Guest with SMP >=2 with kvm_clock has jumping clock every few seconds John Buswell
2010-04-14 15:00 ` John Buswell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox