[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: non-monotonic do_gettimeofday?




On Thu, 5 Sep 2002 johan.adolfsson@xxxxxxx.com wrote:

> > In the 2.4.14 version of time.c (v 1.11), the code in do_getttimeofset
> > refers to two (three according to the
> > comments surrounding it??) - 
> > 
> > 1.the timer wraps around: 
> > the code 
> > if(jiffies_t == jiffies_p)
> > {
> > 	if (count_ > count_p)
> > }
> > 
> > tries to takes care of that. Under what conditions does this happen?
> > is it when we have missed exactly one timer interrupt
> Not missed, but the timer regiser has wrapped but the timer interrupt
> hasn't executed and updated jiffies yet.

but we can also simply miss an interrupt, right? so when the above
condition becomes true, there would be no way of knowing whether we have 
missed an interrupt, or it will happen sometime later (provided the 
timer interrupt is level triggered, and not edge
triggered) - thats not very convenient then.....


> > 2. we are after a timer interrupt, but the bottom half has not
> > executed
> > yet.
> > 
> > what part of the code handles this? should this not be checked by
> > checking 
> > the difference between jiffies and wall_jiffies? 
> 
> Not really sure, and it might be that the comment is a
> remains from the i386 code.

I just checked arch/i386/kernel/time.c, and even they adjust for jiffies
-wall_jiffies, so thats probably a fix need for 2.4.19 version of time.c
anyway....


akshay