From: George Anzinger <george@mvista.com>
To: john stultz <johnstul@us.ibm.com>
Cc: Christoph Lameter <clameter@sgi.com>,
lkml <linux-kernel@vger.kernel.org>,
Tim Schmielau <tim@physik3.uni-rostock.de>,
albert@users.sourceforge.net,
Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>,
Dominik Brodowski <linux@dominikbrodowski.de>,
David Mosberger <davidm@hpl.hp.com>, Andi Kleen <ak@suse.de>,
paulus@samba.org, schwidefsky@de.ibm.com,
keith maanthey <kmannth@us.ibm.com>,
Patricia Gaughen <gone@us.ibm.com>,
Chris McDermott <lcm@us.ibm.com>, Max Asbock <masbock@us.ibm.com>,
mahuja@us.ibm.com, Nishanth Aravamudan <nacc@us.ibm.com>,
Darren Hart <darren@dvhart.com>,
"Darrick J. Wong" <djwong@us.ibm.com>,
Anton Blanchard <anton@samba.org>,
donf@us.ibm.com
Subject: Re: [RFC][PATCH] new timeofday core subsystem (v. A3)
Date: Tue, 15 Mar 2005 14:08:02 -0800 [thread overview]
Message-ID: <42375CC2.9070805@mvista.com> (raw)
In-Reply-To: <1110911106.30498.457.camel@cog.beaverton.ibm.com>
john stultz wrote:
> On Mon, 2005-03-14 at 21:37 -0800, Christoph Lameter wrote:
>
>>Note that similarities exist between the posix clock and the time sources.
>>Will all time sources be exportable as posix clocks?
>
>
> At this point I'm not familiar enough with the posix clocks interface to
> say, although its probably outside the scope of the initial timeofday
> rework.
I do think we need to consider the needs of that subsystem. Clock wise, it
makes a monotonic and a real time clock available to the user. The real time
clock is just a timespec version of the timeval gettimeofday clock. At the
current time, the monotonic clock is the real time clock plus wall_to_monotonic.
All that is rather simple and straight forward, an I don't recommend adding
any other clocks unless there is a real need.
The interesting thing is that the posix timers are based on the posix clocks
which are base on wall_clock, and the jiffies clock which is what runs the
timers. In order to make sense of timer requests it is neccessary to,
atomically, grab all three clocks (i.e. wall_clock aka gettimeofday,
wall_to_monotonic, and jiffies with the jiffies offset). The code can then
figure out when a timer needs to expire in jiffies time in order to expire at a
given wall or monotonic time. Currently the xtime_time sequence lock is used to
do this.
Another issue that posix timers brings forward is the need to know when the
clock is set. This is needed to cause timers that were requested to expire at
some absolute wall_time to do so even if time is set while they are running. A
word on how this is done is in order...
Since the processing of a clock set by the posix timers code may, in fact, allow
the time to be set more than once before the affected timers are adjusted (or
rather to avoid the locking rats nest not allowing this would cause), the
wall_to_monotonic value is exploited. In particular, a clock setting changes
this value by the exact amount that time was adjusted. So, each posix timer
carries the value of wall_to_monotonic that was in use when the timer was
started. The clock_was_set code uses this to compute the clock movement and
thus the adjustment needed to make the timer expire at the right time.
What this translates to in the new code is a) the need for a way to atomically
get all the key times (wall, monotonic, jiffie) and b) access to a value that
will allow it to compute the amount of time a clock set, or a series of clock
settings, changed time by. Of course, it also needs the clock_was_set() notify
call.
>
> Do you have a link that might explain the posix clocks spec and its
> intent?
Well, there is my signature :) Really, on the high-res-timers project site you
want to download the support patch. In there, among other things, is a set of
man pages on posix clocks & timers. The patch applies to any kernel and just
adds a new set of directories off of Documentation.
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
next prev parent reply other threads:[~2005-03-15 22:14 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-12 1:24 [RFC][PATCH] new timeofday core subsystem (v. A3) john stultz
2005-03-12 1:25 ` [RFC][PATCH] new timeofday arch specific hooks " john stultz
2005-03-12 1:26 ` [RFC][PATCH] new timeofday arch specific timesource drivers " john stultz
2005-03-12 5:52 ` [RFC][PATCH] new timeofday arch specific hooks " Benjamin Herrenschmidt
2005-03-14 18:09 ` john stultz
2005-03-15 22:59 ` Pavel Machek
2005-03-15 23:42 ` john stultz
2005-03-15 23:44 ` Pavel Machek
2005-03-16 1:44 ` john stultz
2005-03-16 10:53 ` Pavel Machek
2005-03-13 0:49 ` [RFC][PATCH] new timeofday core subsystem " Matt Mackall
2005-03-13 1:46 ` Andreas Schwab
2005-03-14 18:42 ` john stultz
2005-03-14 19:29 ` Matt Mackall
2005-03-14 19:43 ` john stultz
2005-03-14 19:51 ` Matt Mackall
2005-03-14 20:04 ` john stultz
2005-03-14 20:27 ` Matt Mackall
2005-03-15 0:01 ` Christoph Lameter
2005-03-15 2:16 ` Albert Cahalan
2005-03-15 3:22 ` Christoph Lameter
2005-03-15 15:23 ` Albert Cahalan
2005-03-15 15:52 ` Chris Friesen
2005-03-17 16:55 ` Russell King
2005-03-17 19:44 ` Albert Cahalan
2005-03-17 20:28 ` Russell King
2005-03-15 0:28 ` Christoph Lameter
2005-03-15 0:43 ` john stultz
2005-03-14 23:40 ` George Anzinger
2005-03-15 1:11 ` [topic change] jiffies as a time value john stultz
2005-03-15 23:01 ` George Anzinger
2005-03-16 3:57 ` john stultz
2005-03-15 0:07 ` [RFC][PATCH] new timeofday core subsystem (v. A3) Christoph Lameter
2005-03-15 5:37 ` Christoph Lameter
2005-03-15 18:25 ` john stultz
2005-03-15 22:08 ` George Anzinger [this message]
2005-03-17 8:15 ` Ulrich Windl
2005-03-15 6:09 ` Christoph Lameter
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=42375CC2.9070805@mvista.com \
--to=george@mvista.com \
--cc=ak@suse.de \
--cc=albert@users.sourceforge.net \
--cc=anton@samba.org \
--cc=clameter@sgi.com \
--cc=darren@dvhart.com \
--cc=davidm@hpl.hp.com \
--cc=djwong@us.ibm.com \
--cc=donf@us.ibm.com \
--cc=gone@us.ibm.com \
--cc=johnstul@us.ibm.com \
--cc=kmannth@us.ibm.com \
--cc=lcm@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.de \
--cc=mahuja@us.ibm.com \
--cc=masbock@us.ibm.com \
--cc=nacc@us.ibm.com \
--cc=paulus@samba.org \
--cc=schwidefsky@de.ibm.com \
--cc=tim@physik3.uni-rostock.de \
--cc=ulrich.windl@rz.uni-regensburg.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