Bug 472393 - Invaild clock inside XEN FV/HVM DomU/Guest Domain with SMP
Summary: Invaild clock inside XEN FV/HVM DomU/Guest Domain with SMP
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen
Version: 5.2
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Rik van Riel
QA Contact: Martin Jenner
URL:
Whiteboard:
: 491014 (view as bug list)
Depends On:
Blocks: 514490
TreeView+ depends on / blocked
 
Reported: 2008-11-20 16:53 UTC by Kirby Zhou
Modified: 2018-10-20 01:57 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-22 15:14:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
XenSource 895 0 None None None Never

Description Kirby Zhou 2008-11-20 16:53:24 UTC
Description of problem:

I create serveral HVM/PV DomUs on 3 RHEL-5.2-x86_64 Dom0 box, and set them with vcpus=2. All of them have encountered the same problem. If I ping from the DomU inside to another box, a negative or a huge RTT should appear.

for example: a windows 2003 x64 DomU
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843424ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843428ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843433ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843433ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843433ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843436ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843436ms TTL=128

Version-Release number of selected component (if applicable):
[@63.17 ~]# yum list | fgrep xen | fgrep installed
This system is not registered with RHN.
RHN support will be disabled.
kernel-xen.x86_64                        2.6.18-92.1.13.el5     installed       
xen.x86_64                               3.0.3-64.el5_2.1       installed       
xen-libs.i386                            3.0.3-64.el5_2.1       installed       
xen-libs.x86_64                          3.0.3-64.el5_2.1       installed       

[@63.17 ~]# yum list | fgrep virt
This system is not registered with RHN.
RHN support will be disabled.
libvirt.i386                             0.3.3-7.el5            installed       
libvirt.x86_64                           0.3.3-7.el5            installed       
libvirt-python.x86_64                    0.3.3-7.el5            installed       
python-virtinst.noarch                   0.300.2-8.el5          installed       
virt-manager.x86_64                      0.5.3-8.el5            installed       
virt-viewer.x86_64                       0.0.2-2.el5            installed       

How reproducible:


Steps to Reproduce:
1. setup a hvm domu with vcpus=2, windows/linux guest os are both ok.
2. ping another machine from the domu.
3. check the output of ping
  
Actual results:

  ping get negative or huge result like below
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=-843420ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843424ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843428ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843433ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843433ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843433ms TTL=128
Reply from 10.10.63.22: bytes=32 time<1ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843436ms TTL=128
Reply from 10.10.63.22: bytes=32 time=843436ms TTL=128

Expected results:

  ping get a normal result.

Additional info:

I have not tried i386 host nor guest. Maybe they are broken too.

It seems like http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=895 .
I have tried 'timer_mode=1' , but nothing happens.

Comment 4 Chris Lalancette 2009-03-19 10:59:49 UTC
*** Bug 491014 has been marked as a duplicate of this bug. ***

Comment 6 Issue Tracker 2009-03-23 07:01:14 UTC


This event sent from IssueTracker by mmahudha 
 issue 275099

Comment 8 Rik van Riel 2009-03-23 14:30:57 UTC
What timer source does the HVM domain in comment #0 use?

PIT? TSC? HPET? PMTIMER?

Comment 9 Kirby Zhou 2009-03-23 15:43:34 UTC
I have tried timer=1 and no timer=.
What are your suggestion?

[@63.36 xen]# cat  win2k3-rd-bdc04 
name = "win2k3-rd-bdc04"
uuid = "ae5cb128-e29c-4791-099f-74ca35f4f8cc"
maxmem = 1024
memory = 768
vcpus = 2
builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
boot = "c"
pae = 1
acpi = 1
apic = 0
timer_mode = 1
localtime = 1
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
device_model = "/usr/lib64/xen/bin/qemu-dm"
usbdevice = "tablet"
sdl = 0
vnc = 1
vncunused = 1
disk = [ "phy:/opt/vmware/win2k3-rd-bdc04/main.img,hda,w"]
vif = [ "mac=00:16:3e:20:19:44,bridge=xenbr0" ]
serial = "pty"
[@63.36 xen]#

Comment 10 Kirby Zhou 2009-03-23 15:47:23 UTC
Additional messages:

[@63.36 xen]# rpm -qa | egrep 'xen|virt|qemu'
python-virtinst-0.300.2-12.el5
libvirt-python-0.3.3-14.el5
kernel-xen-devel-2.6.18-128.1.1.el5
xen-libs-3.0.3-80.el5
kernel-xen-2.6.18-128.1.1.el5
virt-manager-0.5.3-10.el5
xen-libs-3.0.3-80.el5
libvirt-0.3.3-14.el5
xen-3.0.3-80.el5
libvirt-0.3.3-14.el5
virt-viewer-0.0.2-2.el5
[@63.36 xen]# uname -a
Linux 63.36 2.6.18-128.1.1.el5xen #1 SMP Mon Jan 26 14:19:09 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[@63.36 xen]# xm info
host                   : 63.36
release                : 2.6.18-128.1.1.el5xen
version                : #1 SMP Mon Jan 26 14:19:09 EST 2009
machine                : x86_64
nr_cpus                : 4
nr_nodes               : 1
sockets_per_node       : 2
cores_per_socket       : 2
threads_per_core       : 1
cpu_mhz                : 1995
hw_caps                : bfebfbff:20100800:00000000:00000140:0004e33d:00000000:00000001
total_memory           : 8191
free_memory            : 2392
node_to_cpu            : node0:0-3
xen_major              : 3
xen_minor              : 1
xen_extra              : .2-128.1.1.el5
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : unavailable
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)
cc_compile_by          : mockbuild
cc_compile_domain      : redhat.com
cc_compile_date        : Mon Jan 26 13:53:58 EST 2009
xend_config_format     : 2

Comment 11 Rik van Riel 2009-03-23 18:17:28 UTC
Xen makes several timer sources available to OSes inside HVM domains.

What timer source does the guest OS inside the HVM domain in comment #0 use?

Comment 13 Kirby Zhou 2009-03-24 02:13:32 UTC
Dear Rik van Riel, how to check which timer source does I taken?
I have already paste my xen domu configuration file in comment #9, is that not enough?

Comment 14 Sadique Puthen 2009-03-24 05:27:56 UTC
The answer to the Rik's question is what timer source windows guest is using. The default timer source in windows is TSC, if you have not changed it. So the answer is TSC.

Unfortunately the problem reported in this bugzilla does not seem to be with underlying Virtualization, but with the QueryPerformanceCounter function in windows. Hence this problem is found if the Hyper-V is used as the virtualization mechanism as well.

The solution is to use /usepmtimer flag in boot.in to set timer srouce as pmtimer on windows. See more details in the below link.

http://blogs.msdn.com/tvoellm/archive/2008/06/05/negative-ping-times-in-windows-vm-s-whats-up.aspx

Rik, is there anything we have to do on this?

Comment 16 Rik van Riel 2009-03-24 14:30:40 UTC
Kirby, if you boot Windows with the /usepmtimer boot flag, does the bug still occur?

Comment 17 Kirby Zhou 2009-03-24 17:11:06 UTC
Thanks to all, it seems ok. At least, there is no negative or very large time in the output of ping.
In my opinion, the modification of /usepmtimer boot flag should become a part of xen-pv driver setup program.

BTW: Is there any linux kernel parameter to adjust the timer for some similar problem inside a KVM or Hyper-V based guest machine?

Comment 18 Sadique Puthen 2009-03-26 04:54:24 UTC
(In reply to comment #17)

> BTW: Is there any linux kernel parameter to adjust the timer for some similar
> problem inside a KVM or Hyper-V based guest machine?  

You should be able to use the pmtmr boot parameter.  The kbase article http://kbase.redhat.com/faq/docs/DOC-3117, though not discussing virtualized systems, does have an example.

Comment 19 Rik van Riel 2009-04-10 17:04:05 UTC
This bug can be caused by a combination of two main factors:
- while doing disk IO, one VCPU of an HVM guest can miss timer ticks
- Xen did not re-deliver those missed timer ticks later on, causing clock skew between VCPUs inside an HVM guest

Both of these issues should be resolved with the backport of the AIO disk handling code and upstream Xen 'no missed-tick accounting' timer code. Please test the test RPMs from http://people.redhat.com/riel/.xenaiotime/ and let us know if those (experimental!) test packages resolve the issue.

Comment 22 Paolo Bonzini 2010-02-23 17:09:46 UTC
Rik,

do you have pointer to 'missed-tick accounting' so that I can take this from you?

Comment 23 Rik van Riel 2010-02-23 17:26:45 UTC
The redelivering of missed ticks is done in our current Xen code base.

What I did not do when backporting those patches is backporting the HPET fixes and improvements, since those seemed to cause a regression in clalance's tests.

Comment 25 Paolo Bonzini 2010-06-22 15:14:28 UTC
This is either fixed or anyway a dup of bug 525752.  Since the reporter was satisfied by /usepmtimer, and the reproduction instructions for the other bug are clear, closing this one.


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