From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>, David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH v2 net-next 06/11] ipv6: change fib6_rules_net_exit() to batch mode
Date: Mon, 7 Feb 2022 20:50:33 -0800 [thread overview]
Message-ID: <20220208045038.2635826-7-eric.dumazet@gmail.com> (raw)
In-Reply-To: <20220208045038.2635826-1-eric.dumazet@gmail.com>
From: Eric Dumazet <edumazet@google.com>
cleanup_net() is competing with other rtnl users.
fib6_rules_net_exit() seems a good candidate for exit_batch(),
as this gives chance for cleanup_net() to progress much faster,
holding rtnl a bit longer.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
---
net/ipv6/fib6_rules.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index ec029c86ae06828c1cfe886ad0f401318b114310..8ad4f49cbe0bb1a31645bbdd4735c69b9b52d8bb 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -486,16 +486,21 @@ static int __net_init fib6_rules_net_init(struct net *net)
goto out;
}
-static void __net_exit fib6_rules_net_exit(struct net *net)
+static void __net_exit fib6_rules_net_exit_batch(struct list_head *net_list)
{
+ struct net *net;
+
rtnl_lock();
- fib_rules_unregister(net->ipv6.fib6_rules_ops);
+ list_for_each_entry(net, net_list, exit_list) {
+ fib_rules_unregister(net->ipv6.fib6_rules_ops);
+ cond_resched();
+ }
rtnl_unlock();
}
static struct pernet_operations fib6_rules_net_ops = {
.init = fib6_rules_net_init,
- .exit = fib6_rules_net_exit,
+ .exit_batch = fib6_rules_net_exit_batch,
};
int __init fib6_rules_init(void)
--
2.35.0.263.gb82422642f-goog
next prev parent reply other threads:[~2022-02-08 5:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 4:50 [PATCH v2 net-next 00/11] net: speedup netns dismantles Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 01/11] ipv6/addrconf: allocate a per netns hash table Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 02/11] ipv6/addrconf: use one delayed work per netns Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 03/11] ipv6/addrconf: switch to per netns inet6_addr_lst hash table Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 04/11] nexthop: change nexthop_net_exit() to nexthop_net_exit_batch() Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 05/11] ipv4: add fib_net_exit_batch() Eric Dumazet
2022-02-08 4:50 ` Eric Dumazet [this message]
2022-02-08 4:50 ` [PATCH v2 net-next 07/11] ip6mr: introduce ip6mr_net_exit_batch() Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 08/11] ipmr: introduce ipmr_net_exit_batch() Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 09/11] can: gw: switch cangw_pernet_exit() to batch mode Eric Dumazet
2022-02-08 8:10 ` Marc Kleine-Budde
2022-02-08 4:50 ` [PATCH v2 net-next 10/11] bonding: switch bond_net_exit() " Eric Dumazet
2022-02-08 4:50 ` [PATCH v2 net-next 11/11] net: remove default_device_exit() Eric Dumazet
2022-02-09 5:20 ` [PATCH v2 net-next 00/11] net: speedup netns dismantles 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=20220208045038.2635826-7-eric.dumazet@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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).