Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Joe Perches
On Tue, 2014-10-14 at 14:19 +0300, Dan Carpenter wrote: > I had a couple small style nits. > > On Tue, Oct 14, 2014 at 04:11:18AM -0700, Thomas Shao wrote: > > diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c > > index 3b9c9ef..1d8390c 100644 > > --- a/drivers/hv/hv_util.c > > +++ b/driver

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Mike Surcouf
>The value for TICK_USEC is defined as ((100UL + USER_HZ/2) / USER_HZ). > In my box, it's 1. OK got it thanks . Checked the algorithm OK by me. Of course you can only adjust clock by a tick (smallest resolution) so you could be flapping between 2 values so as you say NTP is preferred. Howe

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Richard Cochran
On Tue, Oct 14, 2014 at 04:33:46PM +0200, Richard Cochran wrote: > > IMHO, you should let the guest steer its own clock. That gives the end > user the most flexibility. Just provide the offset information, and > let a dedicated service (like ntpd or linuxptp's phc2sys) do the rest. So if it reall

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Victor Miasnikov
Hi! VMware has put a lot of effort into host -> guest timesync so I think there is a case for some form of host based time sync on HyperV. . . . IMHO, you should let the guest steer its own clock. That gives the end user the most flexibility. No problem: Time Sync can be turn off in V

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Richard Cochran
On Tue, Oct 14, 2014 at 03:14:21PM +0100, Mike Surcouf wrote: > Even with networking I think there are other senarios where this would > be useful such as no access to an NTP server due to firewall rules or > no internal NTP or simply an admin without much knowledge of NTP. Perhaps, but ... > Hy

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Richard Cochran
Maybe John Stultz should also go onto CC. Thanks, Richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Richard Cochran
On Tue, Oct 14, 2014 at 02:16:34PM +0100, Mike Surcouf wrote: > What is your expected value for TICK_USEC? I cant make the arithmetic work. > You double the check time if you are close but you never reduce the > check time if you are not. > Adjusting the tick count is a coarse adjustment of the cl

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Mike Surcouf
Even with networking I think there are other senarios where this would be useful such as no access to an NTP server due to firewall rules or no internal NTP or simply an admin without much knowledge of NTP. HyperV host very likely has good time from AD and it would be good if the Linux VM just sy

RE: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Thomas Shao
...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; KY Srinivasan > Subject: Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host > time sample > > On Tue, Oct 14, 2014 at 01:04:35PM +, Thomas Shao wrote: > > > I really don't see the need for this. We have NT

RE: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Thomas Shao
...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; KY Srinivasan > Subject: Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host > time sample > > On Tue, Oct 14, 2014 at 01:04:35PM +, Thomas Shao wrote: > > > > + /* > > > > +

RE: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Thomas Shao
...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; KY Srinivasan > Subject: Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host > time sample > > What is your expected value for TICK_USEC? I cant make the arithmetic work. The value for TICK_USEC is defined as (

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Richard Cochran
On Tue, Oct 14, 2014 at 01:04:35PM +, Thomas Shao wrote: > > 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 gu

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Richard Cochran
On Tue, Oct 14, 2014 at 01:04:35PM +, Thomas Shao wrote: > > > + /* > > > + * 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

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Mike Surcouf
inuxfoundation.org; linux- >> ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; >> a...@canonical.com; jasow...@redhat.com; KY Srinivasan >> Subject: Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host >> time sample >> >> I had a co

RE: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Thomas Shao
anonical.com; > de...@linuxdriverproject.org; t...@linutronix.de > Subject: Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host > time sample > > On Tue, Oct 14, 2014 at 12:50:23PM +, Thomas Shao wrote: > > > > -static inline void do_adj_guesttime(u64 hosttime) > > &g

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Dan Carpenter
On Tue, Oct 14, 2014 at 12:50:23PM +, Thomas Shao wrote: > > > -static inline void do_adj_guesttime(u64 hosttime) > > > +static inline void do_adj_guesttime(u64 hosttime, bool forceSync) > > > > I'm surprise checkpatch.pl does't complain about this CamelCase. > > I've run the scripts/checkpat

RE: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Thomas Shao
.@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; > a...@canonical.com; jasow...@redhat.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: >

RE: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Thomas Shao
...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; KY Srinivasan > Subject: Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host > time sample > > I had a couple small style nits. > > On Tue, Oct 14, 2014 at 04:11:18AM -0700, Thomas Shao wrote: > > diff --git a/driv

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Richard Cochran
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

Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Dan Carpenter
I had a couple small style nits. On Tue, Oct 14, 2014 at 04:11:18AM -0700, Thomas Shao wrote: > diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c > index 3b9c9ef..1d8390c 100644 > --- a/drivers/hv/hv_util.c > +++ b/drivers/hv/hv_util.c > @@ -51,11 +51,30 @@ > #define HB_WS2008_MAJOR 1

[PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Thomas Shao
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 hos