public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christopher Friesen" <cfriesen@nortelnetworks.com>
To: linux-kernel@vger.kernel.org
Subject: Anyone else interested in a high-precision monotonic counter?
Date: Thu, 04 Jan 2001 18:44:08 -0500	[thread overview]
Message-ID: <3A550AC8.D22D0CE4@nortelnetworks.com> (raw)
In-Reply-To: <Pine.BSF.4.21.0012180711330.89819-100000@beppo.feral.com> <3A3E336C.B29BBA89@nortelnetworks.com> <14912.11470.540247.408234@diego.linuxcare.com.au>


Has anyone ever considered including a microsecond-precision
monotonically-increasing counter in the kernel?  This would allow for
easy timing of alarms and such by using absolute values of when the
alarm should expire rather than a list of deltas from previous alarms.

The thing I have in mind would store a value something like "xtime"
(maybe call it "ytime"?) in the kernel.  This value would be initialized
to zero on startup, and would be incremented at the same time as
"xtime".  However, while "xtime" reflects adjustments to the actual
system time (settimeofday(), date, ntp, etc.), this value would not. 
Finally, it would be accessed with a system call essentially identical
to sys_gettimeofday(), only it would access "ytime" instead of "xtime"
before going down and getting the microseconds from the RTC.

This doesn't seem to me as though it would be all that tricky to add,
and I could see it being very useful in providing a timing source that
is guaranteed to a) be accurate to microseconds and b) never go
backwards.


Chris

-- 
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-04 23:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-16 19:07 ServerWorks docs? Rico Tudor
2000-12-16 20:00 ` davej
2000-12-17  2:29   ` Jeff Nguyen
2000-12-18 10:04     ` Rico Tudor
2000-12-18 15:15       ` Matthew Jacob
2000-12-18 15:55         ` gettimeofday() non-monotonic on uniprocessor system with ntp turned off? Christopher Friesen
2000-12-20  3:51           ` Paul Mackerras
2001-01-04 23:44             ` Christopher Friesen [this message]
2001-01-05  3:29               ` Anyone else interested in a high-precision monotonic counter? Manfred Bartz
2001-01-05 14:37                 ` Christopher Friesen
2001-01-12  4:16                   ` Manfred Bartz
2000-12-19  7:10       ` ServerWorks docs? Jeff Nguyen
2000-12-17  3:54   ` Dan Hollis
2000-12-17  0:25 ` J . A . Magallon

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=3A550AC8.D22D0CE4@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.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