Eric Dumazet
00af2aa93b
net/smc: reduce rtnl pressure in smc_pnet_create_pnetids_list()
...
Many syzbot reports show extreme rtnl pressure, and many of them hint
that smc acquires rtnl in netns creation for no good reason [1]
This patch returns early from smc_pnet_net_init()
if there is no netdevice yet.
I am not even sure why smc_pnet_create_pnetids_list() even exists,
because smc_pnet_netdev_event() is also calling
smc_pnet_add_base_pnetid() when handling NETDEV_UP event.
[1] extract of typical syzbot reports
2 locks held by syz-executor.3/12252:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.4/12253:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.1/12257:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.2/12261:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.0/12265:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.3/12268:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.4/12271:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.1/12274:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
2 locks held by syz-executor.2/12280:
#0 : ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
#1 : ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
Signed-off-by: Eric Dumazet <edumazet@google.com >
Cc: Wenjia Zhang <wenjia@linux.ibm.com >
Cc: Jan Karcher <jaka@linux.ibm.com >
Cc: "D. Wythe" <alibuda@linux.alibaba.com >
Cc: Tony Lu <tonylu@linux.alibaba.com >
Cc: Wen Gu <guwen@linux.alibaba.com >
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com >
Link: https://lore.kernel.org/r/20240302100744.3868021-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2024-03-05 15:49:35 +01:00
..
2024-02-09 14:12:01 -08:00
2023-12-13 05:44:30 +09:00
2023-10-28 11:29:28 +01:00
2024-02-26 11:46:12 +00:00
2023-12-26 20:31:01 +00:00
2024-02-09 14:12:01 -08:00
2023-10-01 19:09:54 +01:00
2024-02-02 12:44:16 +00:00
2024-02-28 09:44:11 -05:00
2024-01-31 20:40:56 -08:00
2024-02-29 14:24:56 -08:00
2024-01-05 08:06:35 -08:00
2024-02-20 15:32:45 +01:00
2024-02-07 14:43:29 +01:00
2024-03-05 13:30:11 +01:00
2024-02-02 12:19:26 +00:00
2024-02-21 17:11:04 -08:00
2024-01-11 10:07:29 -08:00
2024-02-26 11:46:12 +00:00
2024-02-28 12:18:05 +00:00
2024-02-08 18:32:29 -08:00
2024-02-29 14:24:56 -08:00
2024-02-26 11:46:12 +00:00
2023-12-15 10:50:18 +00:00
2024-03-05 13:41:16 +01:00
2024-03-05 13:41:16 +01:00
2024-02-22 18:28:13 -08:00
2024-02-21 11:28:57 +00:00
2024-02-09 14:12:01 -08:00
2024-02-22 15:29:26 -08:00
2024-01-30 13:49:09 +01:00
2024-02-29 14:24:56 -08:00
2023-12-15 11:14:57 +01:00
2024-02-29 14:24:56 -08:00
2024-02-26 11:46:12 +00:00
2024-03-04 13:07:46 +00:00
2023-11-18 15:00:51 +00:00
2024-03-02 20:50:59 -08:00
2024-02-28 19:37:34 -08:00
2024-02-29 14:24:56 -08:00
2023-10-01 19:09:54 +01:00
2024-02-06 15:36:06 +01:00
2024-02-09 12:54:38 -08:00
2024-03-05 13:41:16 +01:00
2024-02-22 09:05:50 +01:00
2023-12-29 08:43:59 +00:00
2024-01-01 18:41:29 +00:00
2024-02-15 16:20:04 -08:00
2023-12-21 22:17:23 +01:00
2023-12-15 11:59:53 +00:00
2024-02-05 12:34:07 +00:00
2024-02-22 15:29:26 -08:00
2024-02-15 16:20:04 -08:00
2024-03-05 15:49:35 +01:00
2024-01-29 13:39:48 -05:00
2024-02-16 09:36:37 +00:00
2024-02-15 13:18:19 +01:00
2024-02-29 09:07:16 -08:00
2024-02-22 15:29:26 -08:00
2024-01-23 15:13:54 +01:00
2024-02-29 14:24:56 -08:00
2023-12-26 20:31:01 +00:00
2024-03-02 20:50:59 -08:00
2024-03-02 20:50:59 -08:00
2023-12-12 14:24:14 +01:00
2024-02-18 10:19:21 +00:00
2024-01-31 16:41:16 -08:00
2024-02-28 19:29:46 -08:00