Bug 581396 - [PATCH][RHEL5.5] Fix Time drift on KVM x86_64 RHEL5.5 Guest using PV clock
Summary: [PATCH][RHEL5.5] Fix Time drift on KVM x86_64 RHEL5.5 Guest using PV clock
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.5
Hardware: x86_64
OS: Linux
low
urgent
Target Milestone: rc
: ---
Assignee: Glauber Costa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: Rhel5KvmTier1
TreeView+ depends on / blocked
 
Reported: 2010-04-12 06:11 UTC by Teruaki Ishizaki
Modified: 2013-01-09 22:26 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-13 21:25:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fixed for calculating cycles_per_tick (764 bytes, patch)
2010-04-12 06:13 UTC, Teruaki Ishizaki
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0017 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.6 kernel security and bug fix update 2011-01-13 10:37:42 UTC

Description Teruaki Ishizaki 2010-04-12 06:11:48 UTC
Description of problem:
 On KVM x86_64 RHEL5.5 Guest with clock=tsccount kernel parameter, time
is drift.
 I verified same problem with 2.6.18-164.2.1.el5 or later version.

 Jiffies are calculated with cycles_per_tick and
 cycles_per_tick is incorrect value in x86_64 KVM Guest using
clock=tsccount kernel parameter.

 I made a patch to fix this problem.

How reproducible:
Set x86_64 KVM Guest kernel parameter clocl=tsccount.

Steps to Reproduce:
1. set x86_64 KVM Guest kernel parameter clock=tsccount
2. date; sleep 2; date; sleep 2; ......
3. check speed of date command output

Additional info:
 There is not time drift with kerenel-2.6.18-164.el5.

Comment 1 Teruaki Ishizaki 2010-04-12 06:13:40 UTC
Created attachment 405894 [details]
fixed for calculating cycles_per_tick

Comment 2 Glauber Costa 2010-06-07 15:58:29 UTC
The problem is valid, but the patch is wrong.
It totally breaks kvmclock. I am cooking up a new one, and will submit for inclusion soon.

Comment 5 Jarod Wilson 2010-07-12 15:45:45 UTC
in kernel-2.6.18-206.el5
You can download this test kernel from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 7 Teruaki Ishizaki 2010-07-22 01:54:54 UTC
I understand that it is the following thing, am I right?

==================================================
[when kernel version is kernel-2.6.18-164.2.1.el5 or later version]
1) use_kvm_time = 1 && timekeeping_use_tsc = 1
=> use hypervisor clock(cycles per tick = hv_clock cycle)
2) use_kvm_time = 0 && timekeeping_use_tsc = 1
=> use tsc directly(cycles per tick = cpu_khz(or tsc_khz))
==================================================

I tested using kernel-2.6.18-206.el5 and verified problem was fixed.

Comment 9 errata-xmlrpc 2011-01-13 21:25:44 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0017.html


Note You need to log in before you can comment on or make changes to this bug.