Files
linux-stable-mirror/include/net
Eric DumazetandGreg Kroah-Hartman 760f415e08 net: add exit_batch_rtnl() method
[ Upstream commit fd4f101edb ]

Many (struct pernet_operations)->exit_batch() methods have
to acquire rtnl.

In presence of rtnl mutex pressure, this makes cleanup_net()
very slow.

This patch adds a new exit_batch_rtnl() method to reduce
number of rtnl acquisitions from cleanup_net().

exit_batch_rtnl() handlers are called while rtnl is locked,
and devices to be killed can be queued in a list provided
as their second argument.

A single unregister_netdevice_many() is called right
before rtnl is released.

exit_batch_rtnl() handlers are called before ->exit() and
->exit_batch() handlers.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Link: https://lore.kernel.org/r/20240206144313.2050392-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 46841c7053 ("gtp: Use for_each_netdev_rcu() in gtp_genl_dump_pdp().")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-23 17:17:09 +01:00
..
2023-11-20 11:52:15 +01:00
2024-01-31 16:17:04 -08:00
2024-10-17 15:21:27 +02:00
2024-12-19 18:08:53 +01:00
2023-10-10 22:00:46 +02:00
2023-06-14 11:15:20 +02:00
2024-01-10 17:10:27 +01:00
2023-08-11 12:08:17 +02:00