Skip to content

Commit 92df4c5

Browse files
committed
netfilter: conntrack: warn when cleanup is stuck
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. Acked-by: Florian Westphal <fw@strlen.de> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20251207010942.1672972-5-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 006a503 commit 92df4c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/nf_conntrack_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,7 @@ void nf_conntrack_cleanup_net(struct net *net)
24872487
void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list)
24882488
{
24892489
struct nf_ct_iter_data iter_data = {};
2490+
unsigned long start = jiffies;
24902491
struct net *net;
24912492
int busy;
24922493

@@ -2507,6 +2508,8 @@ void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list)
25072508
busy = 1;
25082509
}
25092510
if (busy) {
2511+
DEBUG_NET_WARN_ONCE(time_after(jiffies, start + 60 * HZ),
2512+
"conntrack cleanup blocked for 60s");
25102513
schedule();
25112514
goto i_see_dead_people;
25122515
}

0 commit comments

Comments
 (0)