lkml.org 
[lkml]   [2001]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [timer] max timeout
sebastien person wrote:
>
> Hi,
>
> is there a max timeout to respect when I use mod_timer ? or add_timer ?
>
> Is it bad to do the following call ?
>
> mod_timer(&timer, jiffies+(0.1*HZ));
>
> that might fire the timer 1/10 second later.
>
> Thanks.
>
More than enough on the fp. Now the other question.

The time value is in jiffies (aka 1/Hz sec.). The max value (in a 32
bit system) is 0x7ffffff. This value is added to the current value of
jiffies to get the the absolute timer expire time. While the value is
unsigned (and thus you could go higher) the compare code (timer_before()
and timer_after()) depend on the subtraction (of jiffies from expire) to
be of the correct sign. To insure this you must keep the timeout values
sign clear (or if you don't like to think of an unsigned as having a
sign, then the highest order bit must be zero).

George
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:53    [W:0.057 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site