lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Oct 2014 13:04:35 +0000
From:	Thomas Shao <huishao@...rosoft.com>
To:	Richard Cochran <richardcochran@...il.com>
CC:	"tglx@...utronix.de" <tglx@...utronix.de>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"olaf@...fle.de" <olaf@...fle.de>,
	"apw@...onical.com" <apw@...onical.com>,
	"jasowang@...hat.com" <jasowang@...hat.com>,
	KY Srinivasan <kys@...rosoft.com>
Subject: RE: [PATCH 2/2] hyperv: Implement Time Synchronization using host
 time sample


> -----Original Message-----
> From: linux-kernel-owner@...r.kernel.org [mailto:linux-kernel-
> owner@...r.kernel.org] On Behalf Of Richard Cochran
> Sent: Tuesday, October 14, 2014 7:54 PM
> To: Thomas Shao
> Cc: tglx@...utronix.de; gregkh@...uxfoundation.org; linux-
> kernel@...r.kernel.org; devel@...uxdriverproject.org; olaf@...fle.de;
> apw@...onical.com; jasowang@...hat.com; KY Srinivasan
> Subject: Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host
> time sample
> 
> On Tue, Oct 14, 2014 at 04:11:18AM -0700, Thomas Shao wrote:
> > In current hyper-v time sync service,it only gets the initial clock
> > time from the host. It didn't process the following time samples. This
> > change introduced a module parameter called host_time_sync. If it is
> > set to true, the guest will periodically sychronize it's time with the
> > host clock using host time sample. By default it is disabled, because
> > we still recommend user to configure NTP for time synchronization.
> 
> I really don't see the need for this. We have NTP. If the guests want to, they
> may use it. Otherwise, they have a free running clock, just like real machines.
> 
Sometimes the user can't setup NTP. For example the guest OS didn't have network
connection. And in some cases, they may want the guest time sync with host. 
With the existing hyper-v time source, the system clock will has around 1.5 second
time drift per day. If the workload in the host is heavy, the number could be larger.
So this feature is really useful for some scenarios.

> > +		/*
> > +		* Use the Hyper-V time sample to adjust the guest time. The
> > +		* algorithm is: If the sample offsets exceeds 1 second, we
> > +		* directly set the clock to the server time. If the offset is
> 
> So the guests will experience random time jumps in the kernel, without any
> rhyme or reason?

This behavior is designed for some extreme cases. Like manually setting guest time
to some value. Or the host resumes from a hibernate state. Normally, we should not
run into this.

> 
> > +		* less than 1ms, we ignore the time sample. Otherwise we
> adjust
> > +		* the clock.
> > +		*/
> 
> So when using this kernel module, the sychronization is never expected to
> be better than one millisecond. That is not too good. I expect NTP can do
> better. So what was the point of this change again?

The time sync component will try to slew the time if the time drift is larger than 
1ms. It doesn't mean the time drift will always be larger than 1ms. This component 
module is trying to keep the time sync with host. And NTP is to keep the time sync 
with external time source from Internet. And yes, NTP has more complicated algorithm,
and it can do better.

> 
> Thanks,
> Richard
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the
> body of a message to majordomo@...r.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists