On Wednesday 03 July 2013 22:26, Roland Dreier wrote:
> Look at the actual timer code.  del_timer_sync() won't work if
> something unrelated re-adds the timer, but it will work if the timer
> itself is what re-adds itself.
> 
> Documentation/DocBook/kernel-locking.tmpl says:
> 
>       Another common problem is deleting timers which restart
>       themselves (by calling <function>add_timer()</function> at the end
>       of their timer function).  Because this is a fairly common case
>       which is prone to races, you should use
> <function>del_timer_sync()</function>
>       (<filename class="headerfile">include/linux/timer.h</filename>)
>       to handle this case.  It returns the number of times the timer
>       had to be deleted before we finally stopped it from adding itself back
>       in.
> 
> which pretty clearly says that del_timer_sync() will work in this case.
> 
> Or look at the code using it in arch/sparc/kernel/led.c for example
> (just one of the first hits in my grep, there are many other
> examples).
> 
> Not a big deal but I'm pretty sure the flag isn't needed.

Thanks for the feedback, Roland!

You are correct, and I removed the "active" flag in V3 of the patch set (to be 
submitted shortly).

-Jack
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to