net: dummy: do not acquire RTNL for too long
Subsystems (2)
PATCH 1/1 net: dummy: do not acquire RTNL for too long
Instead of holding RTNL for an arbitrary amount of time, call register_netdev() for each dummy device created at module loading time.
Tested:
modprobe dummy numdummies=10000
Signed-off-by Eric Dumazet <[email protected]>
--- drivers/net/dummy.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/dummy.c +1 -5
@@ -158,7 +158,7 @@ static int __init dummy_init_one(void)return -ENOMEM ; dev_dummy->rtnl_link_ops = &dummy_link_ops; - err =register_netdevice (dev_dummy); + err =register_netdev (dev_dummy);if (err <0 ) goto err;return 0 ;
@@ -176,15 +176,11 @@ static int __init dummy_init_module(void)if (err <0 )return err; -rtnl_net_lock (&init_net); -for (i =0 ; i < numdummies && !err; i++) { err =dummy_init_one ();cond_resched (); } -rtnl_net_unlock (&init_net); -if (err <0 )rtnl_link_unregister (&dummy_link_ops);
Signature · 1 line
2.54.0.545.g6539524ca2-goog
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Mon, 27 Apr 2026 09:10:16 +0000 you wrote:
Instead of holding RTNL for an arbitrary amount of time, call
register_netdev()for each dummy device created at module loading time.Tested:
modprobe dummy numdummies=10000
[...]
Here is the summary with links:
- [net-next] net: dummy: do not acquire RTNL for too long
https://git.kernel.org/netdev/net-next/c/bed510e44095
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html