timer_gettime returns time in the past, and the timer does not expire

From: Liron Manor (liron_at_qualcomm.com)
Date: 07/13/04


Date: 13 Jul 2004 03:00:09 -0700

Hi,

On Linux 2.4 with 800Hz internal clock on Xeon machine - we are doing
some "soft-real-time" application programming.
Normally the timers work fine, even when loading them (we set the
timer over and over sometimes hundreds of times in a second), but
sometimes the following phenomena occures -
We are calling timer_settime for 40ms from present time, and do not
get notification in the signal handler (handles SIGALRM). When
timer_gettime is called after 200ms from the time the timer was set,
we get back 0xFFFFFFFF in the seconds and about 860ms in the nano
seconds part, which totals to MINUS 160ms (meaning, the timer should
have expired 160ms ago). I suspect that the timer does not expire for
some reason, and that OS continue to decrement the timer after it
reaches 0, consequently, the timer will never expire.

Anyone encountered that issue or got any idea about what can cause it?

Thanks,
Liron.



Relevant Pages

  • [PATCH 11/13] hrtimer: turn hrtimers into range timers
    ... Subject: hrtimer: turn hrtimers into range timers ... this patch turns hrtimers into range timers; they have 2 expire points ... expire point, the kernel now has the freedom to fire this timer at this point, ... the current task state has been set ). ...
    (Linux-Kernel)
  • Re: Help with the high res timers
    ... >> multiple bucket entries would be expired. ... For a HR timer, we need to know ... > HR timer code to take care of the nanosecond remainder. ... > timer for jiffie X will expire prior to a high res timer for jiffie X + Y ...
    (Linux-Kernel)
  • Re: [patch 00/21] hrtimer - High-resolution timer subsystem
    ... >> access to the first expiring timer without walking the rb_tree. ... I have already removed the list_head for the non high resolution ... > really did only expire once. ...
    (Linux-Kernel)
  • Re: Tesing of / bugs in new timerfd API
    ... I found what looks like a bug (see ... CLOCK_REALTIME clock to expire in the past, ... (Nor is it consistent with the behavior of POSIX timers. ... Suppose that we set an absolute timer to expire 100 seconds ...
    (Linux-Kernel)
  • Re: [patch 00/21] hrtimer - High-resolution timer subsystem
    ... > The initial implementation did simply move the timer from the pending ... > This way the list head is only necessary for the high resolution case. ... > It does not expire early. ... Even if the clock ...
    (Linux-Kernel)