Re: [RFC][UPDATE PATCH 2/4] convert soft-timer subsystem to timerintervals

Jonathan Corbet
2005-05-18T16:04:12Z

Hi, Nishanth,

To my uneducated eye, this patch looks like a useful cleaning-up of the
timer API. I do have one question, though...

> @@ -238,15 +327,41 @@ void add_timer_on(struct timer_list *tim
> check_timer(timer);
>
> spin_lock_irqsave(&base->lock, flags);
> + timer->expires = jiffies_to_timerintervals(timer->expires);

It would appear that, depending on where you are, ->expires can be
expressed in two different units. Users of add_timer() and mod_timer()
are expecting jiffies, but the internal code uses timer intervals. What
happens when somebody does something like this?

mod_timer(&my_timer, my_timer.expires + additional_delay);

Might it be better to store the timerintervals value in a different
field, and leave ->expires as part of the legacy interface only?

jon

Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net