[parisc-linux] travel backwards in time?

Randolph Chung randolph@tausq.org
Thu, 18 Oct 2001 13:21:45 -0700


Recently Grant and I have observed several hangs in do_gettimeofday on a
c3k running 32 or 64-bit kernels (UP). 

The symptom we see is gettimeoffset returns a negative number which
results in a huge (unsigned) usec offset in do_gettimeofday, which ends
up spinning in a while loop.

On further investigation we found this piece of code that we don't 
quite understand in the gettimeoffset function:


        /* this is the intended time of the next tick */
        last_tick = cpu_data[smp_processor_id()].it_value;
        /* so subtract one tick */
        /* and account for possible difference between wall and actual time */
        last_tick += clocktick * (jiffies - wall_jiffies - 1);
	
The last_tick adjustment looks a bit odd. Looking at ia64, it looks more
like this:

        last_tick -= clocktick * (jiffies - wall_jiffies + 1);

I tried this and couldn't reproduce the hangs anymore, but am not sure
if this is the right fix.

jsm suggested we try an experiment to disable interrupts in the
timer_interrupt handler. I tried that yesterday (add a __cli() call) and
it didn't seem to fix the hangs.

Can someone more familiar with that part of the code (pb?) please comment?

randolph
-- 
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^