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

From: Jonathan Corbet
Date: Wed May 18 2005 - 11:08:05 EST


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@xxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/