Re: [RFC][PATCH v2 00/31] timers: Use del_timer_shutdown() before freeing timers

From: Trond Myklebust
Date: Fri Oct 28 2022 - 17:57:28 EST




> On Oct 28, 2022, at 16:49, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Fri, 28 Oct 2022 20:12:30 +0000
> Trond Myklebust <trondmy@xxxxxxxxxxxxxxx> wrote:
>
>> I seem to vaguely remember that at the time, del_timer_sync() would loop
>> in order to catch re-arming timers, whereas del_singleshot_timer_sync()
>> would not, hence the commit message. The expectation for
>> del_singleshot_timer_sync() was simply that the caller would ensure
>> safety against re-arming, which was indeed the case for this code.
>
> Well, that expectation didn't last long. Your commit was added on June 22,
> 2005. Then on June 23, 2005 (the next day!) this happened:
>
>
> 55c888d6d09a0 ("timers fixes/improvements")
>
> Which has:
>
> @@ -89,12 +77,12 @@ static inline void add_timer(struct timer_list * timer)
>
> #ifdef CONFIG_SMP
> extern int del_timer_sync(struct timer_list *timer);
> - extern int del_singleshot_timer_sync(struct timer_list *timer);
> #else
> # define del_timer_sync(t) del_timer(t)
> -# define del_singleshot_timer_sync(t) del_timer(t)
> #endif
>
> +#define del_singleshot_timer_sync(t) del_timer_sync(t)
> +
>
>
> So much or efficiency! :-)
>
> I guess converting it back to del_timer_sync() is the right thing to do
> regardless of this patch series. I'll send you a patch.
>
> -- Steve

We’re all moving a lot slower now, 17 years later...

_________________________________
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx