public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* system time
@ 2007-09-26 13:20 Farkas Levente
       [not found] ` <46FA5CB2.70206-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Farkas Levente @ 2007-09-26 13:20 UTC (permalink / raw)
  To: kvm-devel

hi,
there is a strange thing which is just noticed. on our kvm host there is
a ntpd running and synchronize to some time server and it's time is
valid. so i decided that i won't run ntpd on the guest vms since if the
host has the right time probably the guest see the same time. but that's
not the case! there is almost a minute difference between the host and
the guests (all guest has different time). shouldn't the guest see the
host as it's base/bios time? or how it's working? it'd be better to run
ntpd on all guest? why?

-- 
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found] ` <46FA5CB2.70206-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
@ 2007-09-26 13:40   ` Haydn Solomon
       [not found]     ` <b75785ba0709260640v5ef01ca7tff94ec7c8dad44cf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Haydn Solomon @ 2007-09-26 13:40 UTC (permalink / raw)
  To: Farkas Levente; +Cc: kvm-devel


[-- Attachment #1.1: Type: text/plain, Size: 1270 bytes --]

Frakas, I just noticed the same thing. This never used to be the case though
as usually they would be exactly the same time.

On 9/26/07, Farkas Levente <lfarkas-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org> wrote:
>
> hi,
> there is a strange thing which is just noticed. on our kvm host there is
> a ntpd running and synchronize to some time server and it's time is
> valid. so i decided that i won't run ntpd on the guest vms since if the
> host has the right time probably the guest see the same time. but that's
> not the case! there is almost a minute difference between the host and
> the guests (all guest has different time). shouldn't the guest see the
> host as it's base/bios time? or how it's working? it'd be better to run
> ntpd on all guest? why?
>
> --
>   Levente                               "Si vis pacem para bellum!"
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>

[-- Attachment #1.2: Type: text/html, Size: 2017 bytes --]

[-- Attachment #2: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

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

* Re: system time
       [not found]     ` <b75785ba0709260640v5ef01ca7tff94ec7c8dad44cf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-09-26 14:02       ` Haydn Solomon
       [not found]         ` <b75785ba0709260702rb69ab8bldaba9793332223e7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Haydn Solomon @ 2007-09-26 14:02 UTC (permalink / raw)
  To: Farkas Levente; +Cc: kvm-devel


[-- Attachment #1.1: Type: text/plain, Size: 1583 bytes --]

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave
the guest running for a while and see if it eventually goes ahead of host.

On 9/26/07, Haydn Solomon <haydn.solomon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Frakas, I just noticed the same thing. This never used to be the case
> though as usually they would be exactly the same time.
>
> On 9/26/07, Farkas Levente < lfarkas-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org> wrote:
> >
> > hi,
> > there is a strange thing which is just noticed. on our kvm host there is
> >
> > a ntpd running and synchronize to some time server and it's time is
> > valid. so i decided that i won't run ntpd on the guest vms since if the
> > host has the right time probably the guest see the same time. but that's
> >
> > not the case! there is almost a minute difference between the host and
> > the guests (all guest has different time). shouldn't the guest see the
> > host as it's base/bios time? or how it's working? it'd be better to run
> > ntpd on all guest? why?
> >
> > --
> >   Levente                               "Si vis pacem para bellum!"
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2005.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > kvm-devel mailing list
> > kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/kvm-devel
> >
>
>

[-- Attachment #1.2: Type: text/html, Size: 2926 bytes --]

[-- Attachment #2: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

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

* Re: system time
       [not found]             ` <46FB7B0B.5050907-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-27  9:40               ` Farkas Levente
       [not found]                 ` <46FB7AA6.5050708-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Farkas Levente @ 2007-09-27  9:40 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

Avi Kivity wrote:
> Haydn Solomon wrote:
>> I know I'm not crazy.. now my host and guest clocks are in sync. I'll
>> leave the guest running for a while and see if it eventually goes
>> ahead of host.
>>
> 
> Please do this both with and without -no-kvm-irqchip.  The code paths
> are very different.

the simple question does all the guest must be the same system time as
the host? and if it's not the case then it's a bug? or it can happened
with reason?

-- 
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]         ` <b75785ba0709260702rb69ab8bldaba9793332223e7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-09-27  9:42           ` Avi Kivity
       [not found]             ` <46FB7B0B.5050907-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Avi Kivity @ 2007-09-27  9:42 UTC (permalink / raw)
  To: Haydn Solomon; +Cc: kvm-devel

Haydn Solomon wrote:
> I know I'm not crazy.. now my host and guest clocks are in sync. I'll
> leave the guest running for a while and see if it eventually goes
> ahead of host.
>

Please do this both with and without -no-kvm-irqchip.  The code paths
are very different.


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]                     ` <46FB7DFF.6020102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-27  9:50                       ` Farkas Levente
       [not found]                         ` <46FB7CFB.7020607-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Farkas Levente @ 2007-09-27  9:50 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

Avi Kivity wrote:
> Farkas Levente wrote:
>> Avi Kivity wrote:
>>   
>>> Haydn Solomon wrote:
>>>     
>>>> I know I'm not crazy.. now my host and guest clocks are in sync. I'll
>>>> leave the guest running for a while and see if it eventually goes
>>>> ahead of host.
>>>>
>>>>       
>>> Please do this both with and without -no-kvm-irqchip.  The code paths
>>> are very different.
>>>     
>> the simple question does all the guest must be the same system time as
>> the host? and if it's not the case then it's a bug? or it can happened
>> with reason?
>>   
> 
> Difficult to say.  I think that some drift is inevitable as the guest
> and host will calibrate differently.

in the current version or even in long term?
this means it's better to run ntpd on all guests even if it's running on
the host:-((

-- 
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]                 ` <46FB7AA6.5050708-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
@ 2007-09-27  9:55                   ` Avi Kivity
       [not found]                     ` <46FB7DFF.6020102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Avi Kivity @ 2007-09-27  9:55 UTC (permalink / raw)
  To: Farkas Levente; +Cc: kvm-devel

Farkas Levente wrote:
> Avi Kivity wrote:
>   
>> Haydn Solomon wrote:
>>     
>>> I know I'm not crazy.. now my host and guest clocks are in sync. I'll
>>> leave the guest running for a while and see if it eventually goes
>>> ahead of host.
>>>
>>>       
>> Please do this both with and without -no-kvm-irqchip.  The code paths
>> are very different.
>>     
>
> the simple question does all the guest must be the same system time as
> the host? and if it's not the case then it's a bug? or it can happened
> with reason?
>   

Difficult to say.  I think that some drift is inevitable as the guest
and host will calibrate differently.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]                         ` <46FB7CFB.7020607-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
@ 2007-09-27 10:00                           ` Gildas
  2007-09-27 10:07                           ` Avi Kivity
  1 sibling, 0 replies; 12+ messages in thread
From: Gildas @ 2007-09-27 10:00 UTC (permalink / raw)
  To: Farkas Levente; +Cc: kvm-devel, Avi Kivity

2007/9/27, Farkas Levente <lfarkas-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>:
> Avi Kivity wrote:
> > Farkas Levente wrote:
> >> Avi Kivity wrote:
> >>
> >>> Haydn Solomon wrote:
> >>>
> >>>> I know I'm not crazy.. now my host and guest clocks are in sync. I'll
> >>>> leave the guest running for a while and see if it eventually goes
> >>>> ahead of host.
> >>>>
> >>>>
> >>> Please do this both with and without -no-kvm-irqchip.  The code paths
> >>> are very different.
> >>>
> >> the simple question does all the guest must be the same system time as
> >> the host? and if it's not the case then it's a bug? or it can happened
> >> with reason?
> >>
> >
> > Difficult to say.  I think that some drift is inevitable as the guest
> > and host will calibrate differently.
>
> in the current version or even in long term?
> this means it's better to run ntpd on all guests even if it's running on
> the host:-((

To be fair, this problem is not kvm related but also exists on other
solutions, such as vmware esx (check their knowledge base article
ID1420).

HTH,
Gildas

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]                         ` <46FB7CFB.7020607-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
  2007-09-27 10:00                           ` Gildas
@ 2007-09-27 10:07                           ` Avi Kivity
       [not found]                             ` <46FB80D8.7060308-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Avi Kivity @ 2007-09-27 10:07 UTC (permalink / raw)
  To: Farkas Levente; +Cc: kvm-devel

Farkas Levente wrote:
> Avi Kivity wrote:
>   
>> Farkas Levente wrote:
>>     
>>> Avi Kivity wrote:
>>>   
>>>       
>>>> Haydn Solomon wrote:
>>>>     
>>>>         
>>>>> I know I'm not crazy.. now my host and guest clocks are in sync. I'll
>>>>> leave the guest running for a while and see if it eventually goes
>>>>> ahead of host.
>>>>>
>>>>>       
>>>>>           
>>>> Please do this both with and without -no-kvm-irqchip.  The code paths
>>>> are very different.
>>>>     
>>>>         
>>> the simple question does all the guest must be the same system time as
>>> the host? and if it's not the case then it's a bug? or it can happened
>>> with reason?
>>>   
>>>       
>> Difficult to say.  I think that some drift is inevitable as the guest
>> and host will calibrate differently.
>>     
>
> in the current version or even in long term?
>   

It's a fundamental issue due to how PCs do time.  They run a calibration
look during bootup, and if that's not 100% accurate, dirft will occur.


For the long term the solution is paravirtualized time.

> this means it's better to run ntpd on all guests even if it's running on
> the host:-((
>   

I think there are issues with running ntp on the guest due to tsc being
very inaccurate on virtualized guests.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]                             ` <46FB80D8.7060308-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-27 10:13                               ` Farkas Levente
       [not found]                                 ` <46FB823F.5000300-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Farkas Levente @ 2007-09-27 10:13 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

Avi Kivity wrote:
>> this means it's better to run ntpd on all guests even if it's running on
>> the host:-((
>>   
> 
> I think there are issues with running ntp on the guest due to tsc being
> very inaccurate on virtualized guests.

does this means itás not possible to run a guest with accurate time?

-- 
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]                                 ` <46FB823F.5000300-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
@ 2007-09-27 10:45                                   ` Avi Kivity
  2007-09-27 18:26                                   ` Simon Gao
  1 sibling, 0 replies; 12+ messages in thread
From: Avi Kivity @ 2007-09-27 10:45 UTC (permalink / raw)
  To: Farkas Levente; +Cc: kvm-devel

Farkas Levente wrote:
> Avi Kivity wrote:
>   
>>> this means it's better to run ntpd on all guests even if it's running on
>>> the host:-((
>>>   
>>>       
>> I think there are issues with running ntp on the guest due to tsc being
>> very inaccurate on virtualized guests.
>>     
>
> does this means itás not possible to run a guest with accurate time?
>
>   

Time should be mostly accurate.  Running ntpdate every hour or so should
make it even better.  For exact timekeeping a paravirtualized device (or
a mainframe) is necessary.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* Re: system time
       [not found]                                 ` <46FB823F.5000300-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
  2007-09-27 10:45                                   ` Avi Kivity
@ 2007-09-27 18:26                                   ` Simon Gao
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Gao @ 2007-09-27 18:26 UTC (permalink / raw)
  To: Farkas Levente; +Cc: kvm-devel, Avi Kivity

Farkas Levente wrote:
> Avi Kivity wrote:
>   
>>> this means it's better to run ntpd on all guests even if it's running on
>>> the host:-((
>>>   
>>>       
>> I think there are issues with running ntp on the guest due to tsc being
>> very inaccurate on virtualized guests.
>>     
>
> does this means itás not possible to run a guest with accurate time?
>
>   
You can try cron job like this:

15,30,45   *  *  * *      ntpdate    'some time server'  > /dev/null 2>&1

To use ntpdate, ntpd must not run. Adjust frequency of time sync
accordingly

Of course, it would be nice to implement something in kvm to help guest
sync up with host.

Simon


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

end of thread, other threads:[~2007-09-27 18:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-26 13:20 system time Farkas Levente
     [not found] ` <46FA5CB2.70206-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
2007-09-26 13:40   ` Haydn Solomon
     [not found]     ` <b75785ba0709260640v5ef01ca7tff94ec7c8dad44cf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-09-26 14:02       ` Haydn Solomon
     [not found]         ` <b75785ba0709260702rb69ab8bldaba9793332223e7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-09-27  9:42           ` Avi Kivity
     [not found]             ` <46FB7B0B.5050907-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-27  9:40               ` Farkas Levente
     [not found]                 ` <46FB7AA6.5050708-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
2007-09-27  9:55                   ` Avi Kivity
     [not found]                     ` <46FB7DFF.6020102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-27  9:50                       ` Farkas Levente
     [not found]                         ` <46FB7CFB.7020607-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
2007-09-27 10:00                           ` Gildas
2007-09-27 10:07                           ` Avi Kivity
     [not found]                             ` <46FB80D8.7060308-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-27 10:13                               ` Farkas Levente
     [not found]                                 ` <46FB823F.5000300-lWVWdrzSO4GHXe+LvDLADg@public.gmane.org>
2007-09-27 10:45                                   ` Avi Kivity
2007-09-27 18:26                                   ` Simon Gao

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