mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: george anzinger <george@mvista.com>
Cc: Joel Becker <Joel.Becker@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Clock monotonic  a suggestion
Date: 21 Mar 2003 12:53:27 -0800	[thread overview]
Message-ID: <1048280007.4821.301.camel@w-jstultz2.beaverton.ibm.com> (raw)
In-Reply-To: <3E7AC6C9.5000401@mvista.com>

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

On Fri, 2003-03-21 at 00:01, george anzinger wrote:
> Joel Becker wrote:
> > 	If the system is delayed (udelay() or such) by a driver or 
> > something for 10 seconds, then you have this (assume gettimeofday is
> > in seconds for simplicity):
> > 
> > 1    gettimeofday = 1000000000
> > 2    driver delays 10s
> > 3    gettimeofday = 1000000000
> > 4    timer notices lag and adjusts
> 
> Uh, how is this done?  At this time there IS correction for delays up 
> to about a second built into the gettimeofday() code.  You seem to be 
> assuming that we can do better than this with clock monotonic.  Given 
> the right hardware, this may even be possible, but why not correct 
> gettimeofday in the same way?

Because to to it properly is slow. Right now gettimeofday is all done
with 32bit math. However this bounds us to ~2 seconds of counting time
before we overflow the low 32bits of the TSC on a 2GHz cpu.  Rather then
slowing down gettimeofday with 64bit math to be able to handle the crazy
cases where timer interrupts are not handled for more then 2 seconds, we
propose a new interface (monotonic_clock) that provides increased
corner-case accuracy at increased cost. 

thanks
-john

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

  parent reply	other threads:[~2003-03-21 20:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-21  0:16 george anzinger
2003-03-21  2:50 ` Joel Becker
2003-03-21  5:53   ` Chris Friesen
2003-03-21  8:10     ` george anzinger
2003-03-21  8:01   ` george anzinger
2003-03-21 19:43     ` Joel Becker
2003-03-21 20:53     ` john stultz [this message]
2003-03-21 13:17 ` Martin Waitz
2003-03-21 19:18   ` george anzinger
2003-03-21 19:46     ` Joel Becker
2003-03-21 19:44   ` Joel Becker

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=1048280007.4821.301.camel@w-jstultz2.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=Joel.Becker@oracle.com \
    --cc=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®