]> www.infradead.org Git - users/hch/block.git/commitdiff
netfilter: conntrack: expedite rcu in nf_conntrack_cleanup_net_list
authorEric Dumazet <edumazet@google.com>
Fri, 9 Feb 2024 15:31:01 +0000 (15:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Feb 2024 12:17:03 +0000 (12:17 +0000)
nf_conntrack_cleanup_net_list() is calling synchronize_net()
while RTNL is not held. This effectively calls synchronize_rcu().

synchronize_rcu() is much slower than synchronize_rcu_expedited(),
and cleanup_net() is currently single threaded. In many workloads
we want cleanup_net() to be faster, in order to free memory and various
sysfs and procfs entries as fast as possible.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nf_conntrack_core.c

index 2e5f3864d353a39cfde138b725e790d7290b82c9..90e6bd2c30002cbf45f417f014e8493c8d24984b 100644 (file)
@@ -2530,7 +2530,7 @@ void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list)
         *  netfilter framework.  Roll on, two-stage module
         *  delete...
         */
-       synchronize_net();
+       synchronize_rcu_expedited();
 i_see_dead_people:
        busy = 0;
        list_for_each_entry(net, net_exit_list, exit_list) {