2004-04-10 13:35:50

by Denis Vlasenko

[permalink] [raw]
Subject: hangcheck watchdog triggers if clock=pit. Missing code in monotonic_clock_pit()?

linux-2.6.5/arch/i386/kernel/time.c:
====================================
/* monotonic_clock(): returns # of nanoseconds passed since time_init()
* Note: This function is required to return accurate
* time even in the absence of multiple timer ticks.
*/
unsigned long long monotonic_clock(void)
{
return cur_timer->monotonic_clock();
}

linux-2.6.5/arch/i386/kernel/timers/timer_pit.c:
================================================
static unsigned long long monotonic_clock_pit(void)
{
return 0;
}
--
vda


2004-04-12 18:16:58

by john stultz

[permalink] [raw]
Subject: Re: hangcheck watchdog triggers if clock=pit. Missing code in monotonic_clock_pit()?

On Sat, 2004-04-10 at 06:35, Denis Vlasenko wrote:
> linux-2.6.5/arch/i386/kernel/time.c:
> ====================================
> /* monotonic_clock(): returns # of nanoseconds passed since time_init()
> * Note: This function is required to return accurate
> * time even in the absence of multiple timer ticks.
> */
[snip]
> linux-2.6.5/arch/i386/kernel/timers/timer_pit.c:
> ================================================
> static unsigned long long monotonic_clock_pit(void)
> {
> return 0;
> }

Part of the problem is that the PIT timesource cannot account for lost
ticks, thus we cannot strictly conform to the
monotonic_clock()interface.

So either we just return (jiffies_64 * TICK_NSEC), and just have an
exception to the rule, or the hangcheck watchdog needs to know what to
do when monotonic_clock always returns zero.

Joel: Do you have a preference?

thanks
-john