[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjAjW2P5To82+CAM0Rx8RexQBHPTVZBWBPHyEPGm37oFA@mail.gmail.com>
Date: Thu, 27 Oct 2022 13:15:23 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...nel.org>,
Guenter Roeck <linux@...ck-us.net>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Mirko Lindner <mlindner@...vell.com>,
Stephen Hemminger <stephen@...workplumber.org>,
Martin KaFai Lau <martin.lau@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Kuniyuki Iwashima <kuniyu@...zon.com>,
Pavel Begunkov <asml.silence@...il.com>,
Menglong Dong <imagedong@...cent.com>,
linux-usb@...r.kernel.org, linux-wireless@...r.kernel.org,
bridge@...ts.linux-foundation.org, netfilter-devel@...r.kernel.org,
coreteam@...filter.org, lvs-devel@...r.kernel.org,
linux-afs@...ts.infradead.org, linux-nfs@...r.kernel.org,
tipc-discussion@...ts.sourceforge.net
Subject: Re: [RFC][PATCH v2 19/31] timers: net: Use del_timer_shutdown()
before freeing timer
On Thu, Oct 27, 2022 at 12:55 PM Steven Rostedt <rostedt@...dmis.org> wrote:
>
> I think we need to update this code to squeeze in a del_timer_shutdown() to
> make sure that the timers are never restarted.
So the reason the networking code does this is that it can't just do
the old 'sync()' thing, the timers are deleted in contexts where that
isn't valid.
Which is also afaik why the networking code does that whole "timer
implies a refcount to the socket" and then does the
if (del_timer(timer))
sock_put()
thing (ie if the del_timer failed - possibly because it was already
running - you leave the refcount alone).
So the networking code cannot do the del_timer_shutdown() for the same
reason it cannot do the del_timer_sync(): it can't afford to wait for
the timer to stop running.
I suspect it needs something like a new "del_timer_shutdown_async()"
that isn't synchronous, but does that
- acts as del_timer in that it doesn't wait, and returns a success if
it could just remove the pending case
- does that "mark timer for shutdown" in that success case
or something similar.
But the networking people will know better.
Linus
Powered by blists - more mailing lists