On Tue, 2015-08-18 at 13:57 +0000, David Laight wrote: > s the purpose of del_timer_sync() > > I wasn't worried about del_timer_sync(). > The problem is the call to timer_pending(). > > If the timer has just expired, and the timeout function is running > (on another cpu) then timer_pending() will return false.
This case is not a problem. refcount will be properly handled. No leak, no reuse, no crash. > So any tidyup path (apart from that called by the timeout function itself) > will fail to wait for the function to finish. > > So, in effect, you've converted the code back into a call to del_timer(). This is fine. > > timer_pending() should probably never be called without the relevant > timer lock help - because the result is stale. Thats absolutely not true. Please read again timer code and linux code, you'll see lot of timer uses without a lock being held (unserialized use of timers) This is why we have mod_timer_pending() for example. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html