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

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

 



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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux