From: john stultz <johnstul@us.ibm.com>
To: ganzinger@mvista.com
Cc: Tim Schmielau <tim@physik3.uni-rostock.de>,
Andrew Morton <akpm@osdl.org>,
kaukasoi@elektroni.ee.tut.fi, linux-kernel@vger.kernel.org,
davem@redhat.com
Subject: Re: /proc or ps tools bug? 2.6.3, time is off
Date: Thu, 06 May 2004 18:21:19 -0700 [thread overview]
Message-ID: <1083892878.9664.226.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <409AD95F.8080502@mvista.com>
On Thu, 2004-05-06 at 17:33, George Anzinger wrote:
> john stultz wrote:
> > Roughly, I'd like to see the time code for all arches in 2.7 to look
> > like:
> >
> > u64 system_time /* NTP adjusted nanosecs since boot */
> > u64 wall_time_offset /* offset to system_time for time of day */
> > u64 offset_base /* last read raw hw value */
>
> Hm. In 2.6 we use an NTP adjusted wall time and a wall_to_monotonic offset. I
> don't really see the advantage here. Does this change buy us something?
> For what its worth, I introduced the wall_to_monotonic offset just because it
> was easier to do (and understand, I think) in the current kernel.
Well, in my opinion it seems much cleaner. Right now any time we adjust
xtime, we have to remember to adjust wall_to_monotonic. I believe we've
had issues where a change was made to just one and not the other.
This is easier and has simpler rules. system_time always increments and
is only modified by the periodic time_interrupt_hook(). Then
wall_time_offset is only changes by do_settimeofday(). In fact, I hope
to make these values static to the time code, so that all in-kernel
users must go through the monotonic_clock() and do_gettimeofday()
interfaces.
To be brutal, I'd like to see xtime killed completely. Jiffies and HZ
too, although I'd be happy with those two being made static to the
interval timer code. There are too many places where folks have tried to
extrapolate a time value from some global accounting variable, and w/ HZ
not quite being exactly 1000 now on i386, all that code is just slightly
wrong. Its spaghetti code now, and we just need to put that mess behind
a few clean understandable interfaces.
But hey, that's me dreaming, I'm sure there will be some reason odd
someone will need to get into the guts of the time code and we'll have
to break the opacity. :)
And I do realize we'll also need a get_timestamp() or something that
will quickly return a low-res timestamp like the current value of
system_time. I don't intend for all those users of xtime or jiffies to
really go out and hit hardware to calculate a nanosecond accurate time
value.
> > And ignoring the magic NTP_GUNK macros, that's all there is to it
> > (Although don't kid your self, the NTP_GUNK is nasty).
>
> Right, and it needs to be recast to use secs and nanosecs...
Yea, yea, you're right. u64 nanosecond values are just so much simpler
to work with, until you hit the NTP code.
> But you forget the
> accounting code which needs the periodic interrupt to charge time to whom ever.
True, although I'd like to avoid doing that in the time subsystem.
Instead the interval timer subsystem would run the accounting code,
which would then call get_timestamp() to calculate the amount of time to
charge a process.
thanks
-john
next prev parent reply other threads:[~2004-05-07 1:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-25 1:58 David Ford
2004-02-25 1:54 ` Albert Cahalan
2004-02-25 5:10 ` David Ford
2004-02-25 3:27 ` Albert Cahalan
2004-02-25 16:28 ` George Anzinger
2004-02-25 16:04 ` Albert Cahalan
2004-02-25 20:45 ` George Anzinger
2004-02-25 19:16 ` Albert Cahalan
2004-02-25 21:10 ` George Anzinger
2004-02-26 1:52 ` john stultz
2004-02-26 23:06 ` George Anzinger
2004-02-26 23:10 ` john stultz
2004-02-27 0:20 ` George Anzinger
2004-04-13 22:38 ` john stultz
2004-04-13 22:59 ` George Anzinger
2004-04-14 12:10 ` Tim Schmielau
2004-04-14 17:03 ` George Anzinger
2004-04-14 18:28 ` john stultz
2004-04-15 10:37 ` Petri Kaukasoina
2004-04-15 11:05 ` Tim Schmielau
2004-04-15 16:14 ` Petri Kaukasoina
2004-05-01 13:51 ` Tim Schmielau
2004-05-02 1:41 ` Andrew Morton
2004-05-02 1:59 ` Tim Schmielau
2004-05-04 2:40 ` john stultz
2004-05-04 6:12 ` Tim Schmielau
2004-05-04 14:59 ` john stultz
2004-05-04 16:50 ` Tim Schmielau
2004-05-07 0:33 ` George Anzinger
2004-05-07 1:21 ` john stultz [this message]
2004-05-07 20:41 ` George Anzinger
2004-05-07 21:38 ` john stultz
2004-02-26 23:14 ` George Anzinger
2004-02-25 9:14 ` Petri Kaukasoina
2004-02-25 9:18 ` Petri Kaukasoina
2004-02-25 21:39 ` David Ford
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=1083892878.9664.226.camel@cog.beaverton.ibm.com \
--to=johnstul@us.ibm.com \
--cc=akpm@osdl.org \
--cc=davem@redhat.com \
--cc=ganzinger@mvista.com \
--cc=kaukasoi@elektroni.ee.tut.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=tim@physik3.uni-rostock.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®