linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Clock monotonic  a suggestion
@ 2003-03-21  0:16 george anzinger
  2003-03-21  2:50 ` Joel Becker
  2003-03-21 13:17 ` Martin Waitz
  0 siblings, 2 replies; 11+ messages in thread
From: george anzinger @ 2003-03-21  0:16 UTC (permalink / raw)
  To: john stultz, linux-kernel

In an effort to get better resolution and to get CLOCK_MONOTONIC to 
better track CLOCK_REALTIME, I would like to do the following:

Define CLOCK_MONOTONIC to be the same as
(gettimeofday() + wall_to_monotonic).

Wall_to_monotonic would be defined at boot time as -(gettimeofday()) 
at that time and would be updated each time the wall clock is set. 
Currently this happens in only three places in the kernel, two in the 
wall clock update routine (a leap second can be added or subtracted) 
and in settimeofday().  The update of wall_to_monotonic must be done 
under the xtime lock, as should the add to convert gettimeofday() to 
CLOCK_MONOTONIC.

What this gets us is:

Both clocks will tick at the same rate, even under NTP corrections.
The conversion is a simple (well almost simple) add.
Both clocks will have the same resolution.

Comments?

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-03-21 20:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21  0:16 Clock monotonic a suggestion 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
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

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).