lkml.org 
[lkml]   [2003]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][2.5] hangcheck-timer
From
Date
On Mon, 2003-01-20 at 18:00, Joel Becker wrote:
> On Mon, Jan 20, 2003 at 05:42:16PM -0800, john stultz wrote:
> > get_cycles() is a poor method for determining "real time".
> > Please use do_gettimeofday().
>
> Does do_gettimeofday() exist on all platforms? Does it indeed
> give actual wall clock time, instead of the inaccurate time jiffies can
> give?

Yep, do_gettimeofday is called from generic code in sys_gettimeofday()
(kernel/time.c). It returns the same value userspace code would see
calling gettimeofday().

> > > + if (tsc_diff > hangcheck_tsc_margin) {
> >
> > but now we're using it to compare cycles! 180sec != 180 cycles
>
> Look at the calculations. I'm comparing cycles to cycles,
> calculated from the original seconds.

Ah! Ok, I missed the conversion in hangcheck_init. Even so, the default
initializer is misleading. Yea, that's it... :)

> > Additionally, this code doesn't take systems that have unsync'ed TSCs,
> > or systems that change cpu frequency into account. Again, please use
> > do_gettimeofday(). Then you can then talk about the values returned in
> > secs and usecs, and I believe things will be much more clear.
>
> I'll look into it, but it must absolutely be in terms of wall
> clock time as measured from outside the system.

Completely understandable. do_gettimeofday will give you just that (w/o
the conversion muck w/ HZ and loops_per_jiffy).

thanks
-john

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site