linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Shao <huishao@microsoft.com>
To: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"apw@canonical.com" <apw@canonical.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	KY Srinivasan <kys@microsoft.com>,
	Richard Cochran <rcochran@linutronix.de>
Subject: RE: [PATCH v2 1/2] timekeeping: add EXPORT_SYMBOL_GPL for do_adjtimex()
Date: Tue, 21 Oct 2014 04:08:57 +0000	[thread overview]
Message-ID: <CD2CABCB2C0A0D4682C5F8AD840141540D290B@HKXPRD3002MB006.064d.mgd.msft.net> (raw)
In-Reply-To: <CALAqxLVKZKQn628ZUa1D9ev37DUz+h4y5AXhMqCg_8dJ7JkEDw@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3864 bytes --]



> -----Original Message-----
> From: John Stultz [mailto:john.stultz@linaro.org]
> Sent: Tuesday, October 21, 2014 11:24 AM
> To: Thomas Shao
> Cc: Thomas Gleixner; gregkh@linuxfoundation.org; LKML;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com; KY Srinivasan; Richard Cochran
> Subject: Re: [PATCH v2 1/2] timekeeping: add EXPORT_SYMBOL_GPL for
> do_adjtimex()
> 
> On Mon, Oct 20, 2014 at 8:18 PM, Thomas Shao <huishao@microsoft.com>
> wrote:
> >
> >> -----Original Message-----
> >> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> >> owner@vger.kernel.org] On Behalf Of Thomas Gleixner
> >> Sent: Tuesday, October 21, 2014 2:41 AM
> >> To: Thomas Shao
> >> Cc: gregkh@linuxfoundation.org; LKML; devel@linuxdriverproject.org;
> >> olaf@aepfle.de; apw@canonical.com; jasowang@redhat.com; KY
> >> Srinivasan; John Stultz; Richard Cochran
> >> Subject: Re: [PATCH v2 1/2] timekeeping: add EXPORT_SYMBOL_GPL for
> >> do_adjtimex()
> >>
> >> On Mon, 20 Oct 2014, Thomas Gleixner wrote:
> >>
> >> > On Wed, 15 Oct 2014, Thomas Shao wrote:
> >> >
> >> > And again you forgot to cc John Stultz on this....
> >> >
> >> > > Export do_adjtimex function for hyper-v Time Synchronization
> >> > > component
> >>
> >> Aside of that, we really want to see the use case for this and how
> >> you addressed the problems which were pointed out by various folks.
> >>
> >
> > In some situation, the user is not able to enable guest VM to sync
> > with external time source, like NTP. But the host is still synced with a
> trusted time source.
> > In this case, host-guest time synchronization is useful. Hyper-v host
> > will send time sample to guest VM every 5 seconds. We will use these
> > time samples to adjust guest VM time.
> >
> > I've got some feedbacks from Richard and Mike, including reference NTP
> > implementation and do the adjustment in the host side. I've already
> > referenced some NTP design in my patch. I would consider my patch as a
> > simplified implementation. I've also considered the host side
> > implementation. But in host, we can only set time but not gradually
> > slew/adjust time, which is not acceptable for the time sync
> > solution.We still recommend user to configure NTP on the guest, which
> provides better accuracy. But if NTP is not applicable, this could be another
> option.
> >
> >> I still do not have a consistent argument from you WHY you need to
> >> abuse
> >> do_adjtimex() to do that host - guest synchronization in the first place.
> >>
> >
> > I need a function to gradually slew guest time. do_adjtimex() provides
> > all the functionality. Also I could not find any other exposed func to
> > do this. I'd like to hear any feedback from you for this.
> 
> Do you have any protections from both your kernel module trying to slew
> time if the guest is also running NTPd? That seems like it could cause some
> strange behavior.

Thanks John.
I didn't find a way to detect whether NTPd is running in the hyper-v module.  

In http://doc.ntp.org/4.1.0/ntpd.htm, it mentioned: Normally, the time is slewed
 if the offset is less than the step threshold, which is 128 ms by default, and 
stepped if above the threshold.

In my implementation, I use 100ms as the threshold (maybe I should change to 128?).
If the time difference is less than 100ms, I just do nothing. So, if NTPd is running, ideally it 
could keep the time drift less than 128, so the adjustment in my patch will not get 
triggered. 

And moreover, by default, the guest-host time sync is turn off. There is a module parameter
to control it. We'll also document customer that do not turn on this if NTP is configured.

> 
> thanks
> -john
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2014-10-21  4:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15  8:39 [PATCH v2 1/2] timekeeping: add EXPORT_SYMBOL_GPL for do_adjtimex() Thomas Shao
2014-10-20 18:28 ` Thomas Gleixner
2014-10-20 18:40   ` Thomas Gleixner
2014-10-21  3:18     ` Thomas Shao
2014-10-21  3:24       ` John Stultz
2014-10-21  4:08         ` Thomas Shao [this message]
2014-10-21  8:23           ` Thomas Gleixner
2014-10-21  4:02       ` Jeff Epler
2014-10-21  4:55         ` Thomas Shao
2014-10-21  8:25           ` Thomas Gleixner
2014-10-21  8:20         ` Richard Cochran
2014-10-21 10:11           ` Thomas Shao
2014-10-22 11:01             ` Mike Surcouf
2014-10-22 12:42               ` Thomas Gleixner
2014-10-22 13:51                 ` Thomas Shao
2014-10-22 14:20                   ` Mike Surcouf
2014-10-21  8:13       ` Richard Cochran
2014-10-21  9:16         ` Thomas Shao
2014-10-21  8:19       ` Thomas Gleixner
2014-10-21  9:02         ` Thomas Shao
2014-10-21  2:37   ` Thomas Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CD2CABCB2C0A0D4682C5F8AD840141540D290B@HKXPRD3002MB006.064d.mgd.msft.net \
    --to=huishao@microsoft.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=john.stultz@linaro.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=rcochran@linutronix.de \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).