mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: george@mvista.com
Cc: Daniel Walker <dwalker@mvista.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	ganzinger@mvista.com, linux-kernel@vger.kernel.org
Subject: Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
Date: Thu, 20 Oct 2005 16:23:37 -0700	[thread overview]
Message-ID: <1129850617.27168.192.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <435817F1.3000402@mvista.com>

On Thu, 2005-10-20 at 15:19 -0700, George Anzinger wrote:
> Daniel Walker wrote:
> > On Thu, 20 Oct 2005, Steven Rostedt wrote:
> > 
> >>
> >> Yes, but that shouldn't make a difference.  NTP can slow down or speed up
> >> the clock, but it should never make it go backwards. Especially for a
> >> monotonic clock (as the name suggests).
> > 
> > 
> >     It looks like if ntp_adj held a big negative number you might end up 
> > with a smaller output . ntp_adj is signed too .. I don't know how 
> > ntp_adj is set though .
> > 
> >     I thought I remember George Anzinger speculating that ntp could 
> > cause the time to backwards , that's why I brought it up. Maybe if he's 
> > read he can clue us in ..
> > 
> I think John has changed this, but in the "old" code if ntp was correcting the clock such that less 
> than TICK_NSEC was added on a tick, AND, the time was read just prior to this tick the get_offset 
> code would return ~TICK_NSEC of offset which would mean that a read right after the tick might be 
> less than the one just prior to the tick.  The error, however, would be in the nanosecond area (no 
> where near a second).  Again, as I said, I think John has changed this in is code so that the 
> get_offset equivalent is also ntp corrected, thus eliminating the small back step.
> > 

Indeed. This is one of the bugs my patch addresses. NTP adjustments are
made as frequency adjustments for a entire interval, rather then fixed
value adjustments made at tick time. Thus time is accumulated in the
same way it is calculated in gettimeofday, avoiding time
inconsistencies. 

However, my code does require periodic_hook be called at least once per
rollover of the clocksource counter, so that we get a chance to
accumulate time properly. But considering the current code has issues if
we miss a single tick, I consider it an improvement. :)

thanks
-john



  reply	other threads:[~2005-10-20 23:23 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-19 14:59 Steven Rostedt
2005-10-19 15:10 ` Thomas Gleixner
2005-10-19 18:39   ` john stultz
2005-10-20  6:55     ` Steven Rostedt
2005-10-20  7:34       ` Ingo Molnar
2005-10-20  7:46         ` Steven Rostedt
2005-10-20  8:01           ` Ingo Molnar
2005-10-20  8:56             ` Steven Rostedt
2005-10-20  8:59               ` Ingo Molnar
2005-10-20  9:04                 ` Steven Rostedt
2005-10-20  9:05                   ` Steven Rostedt
2005-10-20 10:05                   ` Steven Rostedt
2005-10-20 10:05                     ` Steven Rostedt
2005-10-20 15:55                       ` Ingo Molnar
2005-10-20 16:09                         ` Steven Rostedt
2005-10-20 16:45                       ` john stultz
2005-10-20 16:58                         ` Steven Rostedt
2005-10-20 17:05                           ` john stultz
2005-10-20 19:32                         ` Ingo Molnar
2005-10-20 20:05                           ` john stultz
2005-10-20 20:54                             ` Ingo Molnar
2005-10-21  6:03                           ` Steven Rostedt
2005-10-21  7:49                             ` Thomas Gleixner
2005-10-21  7:57                               ` Steven Rostedt
2005-10-21  8:00                               ` ktimer API Steven Rostedt
2005-10-21  8:09                                 ` Thomas Gleixner
2005-10-21 18:09                             ` Ktimer / -rt9 (+custom) monotonic_clock going backwards john stultz
2005-10-21 18:15                               ` Thomas Gleixner
2005-10-20 22:06           ` George Anzinger
2005-10-20  6:19   ` Steven Rostedt
2005-10-20 14:34   ` Steven Rostedt
2005-10-20 15:18     ` Steven Rostedt
2005-10-20 15:23       ` Steven Rostedt
2005-10-20 16:01       ` Steven Rostedt
2005-10-19 15:11 ` Ingo Molnar
2005-10-20  6:38   ` Steven Rostedt
2005-10-20  6:56     ` Ingo Molnar
2005-10-19 15:21 ` Daniel Walker
2005-10-20  6:39   ` Steven Rostedt
2005-10-20 15:02     ` Daniel Walker
2005-10-20 22:19       ` George Anzinger
2005-10-20 23:23         ` john stultz [this message]
2005-10-19 16:44 ` Frank Sorenson
2005-10-20  6:43   ` Steven Rostedt

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=1129850617.27168.192.camel@cog.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=dwalker@mvista.com \
    --cc=ganzinger@mvista.com \
    --cc=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --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

all inboxes | Powered by JetHome®