Re: [PATCH][2.5] hangcheck-timer

From: Joel Becker (
Date: Mon Jan 20 2003 - 21:00:16 EST

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

> I believe you mean "udelay for 60 micro-seconds"

        No, I mean 60 *seconds*. There have been drivers and such that
do pause the entire box that long.

> Wait, so 180 seconds is the margin of error?

        Yup, for the default. I'm not beholden to these specific
defaults. They're just the defaults we use in our environment.

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

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



Life's Little Instruction Book #99

"Think big thoughts, but relish small pleasures."

Joel Becker Senior Member of Technical Staff Oracle Corporation E-mail: Phone: (650) 506-8127 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:25 EST