Bug 581396 - [PATCH][RHEL5.5] Fix Time drift on KVM x86_64 RHEL5.5 Guest using PV clock
[PATCH][RHEL5.5] Fix Time drift on KVM x86_64 RHEL5.5 Guest using PV clock
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.5
x86_64 Linux
low Severity urgent
: rc
: ---
Assigned To: Glauber Costa
Virtualization Bugs
:
Depends On:
Blocks: Rhel5KvmTier1
  Show dependency treegraph
 
Reported: 2010-04-12 02:11 EDT by Teruaki Ishizaki
Modified: 2013-01-09 17:26 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-13 16:25:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Teruaki Ishizaki 2010-04-12 02:11:48 EDT
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 02:13:40 EDT
Created attachment 405894 [details]
fixed for calculating cycles_per_tick
Comment 2 Glauber Costa 2010-06-07 11:58:29 EDT
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 11:45:45 EDT
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-21 21:54:54 EDT
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 16:25:44 EST
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.