WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Time diferrence between dom0 and domU

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Time diferrence between dom0 and domU
From: Bartosz Lis <bartoszl@xxxxxxxxxxxxx>
Date: Fri, 6 Nov 2009 10:20:55 +0100
Delivery-date: Fri, 06 Nov 2009 01:21:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AF06E3C.6040002@xxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Organization: Politechnika Łódzka
References: <4AF06E3C.6040002@xxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.12.3 (Linux/2.6.31.4x_xen0nogrsecurity-BL5.0; KDE/4.3.3; x86_64; ; )
Dnia wtorek, 3 listopada 2009 o 18:54:04 Jordi Espasa Clofent napisał(a):
> Hi all,
> 
> In dom0:
> 
> xen01ad:/# ls -l /etc/localtime
> lrwxrwxrwx 1 root root 33 2009-07-02 10:51 /etc/localtime ->
> /usr/share/zoneinfo/Europe/Madrid
> xen01ad:/# ntpdate hora.rediris.es
>   3 Nov 18:49:46 ntpdate[9558]: adjust time server 130.206.3.166 offset
> 0.163783 sec
> 
> In domU:
> 
> xen-ad0006:~# date
> Tue Nov  3 18:55:29 CET 2009
> xen-ad0006:~# ls -l /etc/localtime
> lrwxrwxrwx 1 root root 33 Nov  3 13:24 /etc/localtime ->
> /usr/share/zoneinfo/Europe/Madrid
> xen-ad0006:~# ntpdate hora.rediris.es
>   3 Nov 18:55:44 ntpdate[19800]: step time server 130.206.3.166 offset
> -294.467004 sec
> 
> As you can see, the time difference between dom0 and domU is aprox 6 min.
> ¿why?
> 
> It's supposed that domUs has the dom0's time.
> 
> Info:
> 
> * I don't use the independent_wallclock
> * xen01ad:/# uname -a && xm info
> Linux xen01ad 2.6.18-6-xen-amd64 #1 SMP Tue May 5 09:56:33 UTC 2009
> x86_64 GNU/Linux
> host                   : xen01ad
> release                : 2.6.18-6-xen-amd64
> version                : #1 SMP Tue May 5 09:56:33 UTC 2009
> machine                : x86_64
> nr_cpus                : 8
> nr_nodes               : 1
> cores_per_socket       : 4
> threads_per_core       : 1
> cpu_mhz                : 2110
> hw_caps                :
> 178bf3ff:efd3fbff:00000000:00000110:00802001:00000000:000037ff
> total_memory           : 16383
> free_memory            : 4161
> node_to_cpu            : node0:0-7
> xen_major              : 3
> xen_minor              : 2
> xen_extra              : -1
> 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_scheduler          : credit
> xen_pagesize           : 4096
> platform_params        : virt_start=0xffff800000000000
> xen_changeset          : unavailable
> cc_compiler            : gcc version 4.3.1 (Debian 4.3.1-2)
> cc_compile_by          : waldi
> cc_compile_domain      : debian.org
> cc_compile_date        : Sat Jun 28 09:32:18 UTC 2008
> xend_config_format     : 4
> 

Jordi,

I'm facing similar problems. My ocnfiguration: XEN 3.4.1 + kernel from 
http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git;a=shortlog;h=xen/master

I observe problems:

1. Just afer DomU starts it's time differs from dom0 clocks: software (date) 
and hardware (hwclock --show --utc). In my case it's ~10s. It's not caused by 
wrong /etc/localtime. If it were, then round hours would be the difference. 

2. DomU's clock drifts.

I've made 2 things as a workaround:

1. I've installed ntpd in domU, too. I read somewhere that it sould be done as 
a workaround, until the source of te poblem is found and fixed. With ntpd 
running DomU's clock still drifted, but when the difference was approaching 1s 
ntpd reseted the clock. 

2. I've changed timer interrupt frequencies to 1000Hz in dom0 and to 100Hz in 
domU. That was done by kernel recompilation, of course. Now, domU's clocks 
differ from dom0 in range ~10ms when under small load or ~100ms under havy 
load. Furthemore, the differences are steady - I do not observe leaps as It 
was when domU and dom0 timer interrupt frequencies were equal.

It's also handy to do:

3. On dom0 put into /etc/cron.hourly a script doing:
/sbin/hwclock --systohc --utc

I'm going to report my problems to xen-devel and ask them to write some wiki 
article on time keeping.

Kind regards,

-- 
Bartosz Lis @ Institute of Comp. Science, Technical University of Lodz, Poland
   bartoszl @ ics.p.lodz.pl

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users