From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, pablo@netfilter.org,
fw@strlen.de, netfilter-devel@vger.kernel.org,
willemdebruijn.kernel@gmail.com, kuniyu@google.com,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net 4/4] netfilter: conntrack: warn when cleanup is stuck
Date: Sat, 6 Dec 2025 17:09:42 -0800 [thread overview]
Message-ID: <20251207010942.1672972-5-kuba@kernel.org> (raw)
In-Reply-To: <20251207010942.1672972-1-kuba@kernel.org>
nf_conntrack_cleanup_net_list() calls schedule() so it does not
show up as a hung task. Add an explicit check to make debugging
leaked skbs/conntack references more obvious.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/netfilter/nf_conntrack_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 0b95f226f211..d1f8eb725d42 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -2487,6 +2487,7 @@ void nf_conntrack_cleanup_net(struct net *net)
void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list)
{
struct nf_ct_iter_data iter_data = {};
+ unsigned long start = jiffies;
struct net *net;
int busy;
@@ -2507,6 +2508,8 @@ void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list)
busy = 1;
}
if (busy) {
+ DEBUG_NET_WARN_ONCE(time_after(jiffies, start + 60 * HZ),
+ "conntrack cleanup blocked for 60s");
schedule();
goto i_see_dead_people;
}
--
2.52.0
next prev parent reply other threads:[~2025-12-07 1:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-07 1:09 [PATCH net 0/4] inet: frags: flush pending skbs in fqdir_pre_exit() Jakub Kicinski
2025-12-07 1:09 ` [PATCH net 1/4] inet: frags: avoid theoretical race in ip_frag_reinit() Jakub Kicinski
2025-12-08 15:18 ` Eric Dumazet
2025-12-07 1:09 ` [PATCH net 2/4] inet: frags: add inet_frag_queue_flush() Jakub Kicinski
2025-12-08 15:19 ` Eric Dumazet
2025-12-07 1:09 ` [PATCH net 3/4] inet: frags: flush pending skbs in fqdir_pre_exit() Jakub Kicinski
2025-12-08 15:17 ` Eric Dumazet
2025-12-07 1:09 ` Jakub Kicinski [this message]
2025-12-07 10:21 ` [PATCH net 4/4] netfilter: conntrack: warn when cleanup is stuck Florian Westphal
2025-12-08 15:20 ` Eric Dumazet
2025-12-10 9:50 ` [PATCH net 0/4] inet: frags: flush pending skbs in fqdir_pre_exit() patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251207010942.1672972-5-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).