Skip to contentSkip to conversation

travel backwards in time?

parisc-linux Randolph Chung 2 participants 2 messages Oct 18, 2001

lore
Share & tools
lore
#0 lore raw

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

Signature · 4 lines
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^
#1 lore raw
Quoted 3 lines

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

I never had lots of confidence in that code even though I introduced it by distilling other archs -- and dimly recall not being able to use ia64 for some reason, or maybe I'm remembering wrong. I never felt I completely understood the interaction with the sometimes-missed timer interrupt and arch-independent timer handling, and some of the other archs seemed to be unexpectedly different from each other.

How's that for a useless comment?! :-)

	-P