Skip to contentSkip to conversation

net: dummy: do not acquire RTNL for too long

PATCH Applied Eric Dumazet 2 participants 2 messages Apr 27 – Apr 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

---
 drivers/net/dummy.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/dummy.c +1 -5
index f8a4eb365c3d068399c7af9305785aea1a5a7aac..f6732eab5923f02d0164f2a47258b87740f8c593 100644
@@ -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
#1 lore raw
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