Re: [PATCH v5a 5/5] treewide: Convert del_timer*() to timer_shutdown*()

From: Steven Rostedt
Date: Sun Nov 06 2022 - 17:53:11 EST


On Sun, 6 Nov 2022 14:40:14 -0800
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> I do think that you should just remove that E expression and the
> "function = E" part.
>
> Really, _any_ use of the timer after the timer delete makes it questionable,
>
> It doesn't change the patch in my testing, but I think it's silly to
> have that very specific pattern, when the more general case of "hey,
> if you use the timer after deleting it, it's not obvious that it
> should be a shutdown any more" just is more sensible anyway.

OK, I updated the script to:

@@
expression ptr, slab;
identifier timer, rfield;
@@
(
- del_timer(&ptr->timer);
+ timer_shutdown(&ptr->timer);
|
- del_timer_sync(&ptr->timer);
+ timer_shutdown_sync(&ptr->timer);
)
... when strict
when != ptr->timer
(
kfree_rcu(ptr, rfield);
|
kmem_cache_free(slab, ptr);
|
kfree(ptr);
)

And produced no difference from https://lore.kernel.org/all/20221106212702.547242324@xxxxxxxxxxx/

I can post a v7a with the updated change log and also Guenter's
tested-by tag. But the patches will remain the same. Are you going to
just take that then?

-- Steve