Re: [patch 04/15] timers: Get rid of del_singleshot_timer_sync()
From: Steven Rostedt
Date: Mon Nov 21 2022 - 15:08:50 EST
On Tue, 15 Nov 2022 21:28:39 +0100 (CET)
Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> del_singleshot_timer_sync() used to be an optimization for deleting timers
> which are not rearmed from the timer callback function.
>
> This optimization turned out to be broken and got mapped to
> del_timer_sync() about 17 years ago.
>
> Get rid of the undocumented indirection and use del_timer_sync() directly.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -1164,7 +1164,7 @@ xprt_request_enqueue_receive(struct rpc_
> spin_unlock(&xprt->queue_lock);
>
> /* Turn off autodisconnect */
> - del_singleshot_timer_sync(&xprt->timer);
> + del_timer_sync(&xprt->timer);
And this was not even a single shot timer. It used the
del_singleshot_timer_sync() function because of incorrect assumptions.
Link: https://lore.kernel.org/all/20221105060155.047357452@xxxxxxxxxxx/
0f9dc2b16884b ("RPC: Clean up socket autodisconnect")
55c888d6d09a0 ("timers fixes/improvements")
Reviewed-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
-- Steve
> return 0;
> }
>