diff options
author | David S. Miller <[email protected]> | 2024-02-12 12:17:03 +0000 |
---|---|---|
committer | David S. Miller <[email protected]> | 2024-02-12 12:17:03 +0000 |
commit | 0f37666d87d2dea42ec21776c3d562b7cbd71612 (patch) | |
tree | 4dc5ebc60fcc3e6bdfa134b20016b41b5c6fa3b1 | |
parent | 03f568a1577aaaabc6145cbbbe6adc009d82fb61 (diff) | |
parent | 1ebb85f9c03de0b66c334de219f224159e24e549 (diff) |
Merge branch 'net-avoid-slow-rcu'
Eric Dumazet says:
====================
net: avoid slow rcu synchronizations in cleanup_net()
RTNL is a contended mutex, we prefer to expedite rcu synchronizations
in contexts we hold RTNL.
Similarly, cleanup_net() is a single threaded critical component and
should also use synchronize_rcu_expedited() even when not holding RTNL.
First patch removes a barrier with no clear purpose in ipv6_mc_down()
====================
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | net/bridge/br_vlan.c | 4 | ||||
-rw-r--r-- | net/core/dev.c | 2 | ||||
-rw-r--r-- | net/core/net_namespace.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 1 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 2 |
6 files changed, 6 insertions, 7 deletions
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index 15f44d026e75..9c2fffb827ab 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -841,7 +841,7 @@ void br_vlan_flush(struct net_bridge *br) vg = br_vlan_group(br); __vlan_flush(br, NULL, vg); RCU_INIT_POINTER(br->vlgrp, NULL); - synchronize_rcu(); + synchronize_net(); __vlan_group_free(vg); } @@ -1372,7 +1372,7 @@ void nbp_vlan_flush(struct net_bridge_port *port) vg = nbp_vlan_group(port); __vlan_flush(port->br, port, vg); RCU_INIT_POINTER(port->vlgrp, NULL); - synchronize_rcu(); + synchronize_net(); __vlan_group_free(vg); } diff --git a/net/core/dev.c b/net/core/dev.c index 31f2c97d1990..7cf15d2bf78d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1239,7 +1239,7 @@ rollback: netdev_name_node_del(dev->name_node); write_unlock(&dev_base_lock); - synchronize_rcu(); + synchronize_net(); write_lock(&dev_base_lock); netdev_name_node_add(net, dev->name_node); diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 233ec0cdd011..f0540c557515 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -622,7 +622,7 @@ static void cleanup_net(struct work_struct *work) * the rcu_barrier() below isn't sufficient alone. * Also the pre_exit() and exit() methods need this barrier. */ - synchronize_rcu(); + synchronize_rcu_expedited(); rtnl_lock(); list_for_each_entry_reverse(ops, &pernet_list, list) { diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 3ff35f811765..0fc7ab5832d1 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -501,7 +501,7 @@ static void tnode_free(struct key_vector *tn) if (tnode_free_size >= READ_ONCE(sysctl_fib_sync_mem)) { tnode_free_size = 0; - synchronize_rcu(); + synchronize_net(); } } diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index bc6e0a0bad3c..76ee1615ff2a 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -2719,7 +2719,6 @@ void ipv6_mc_down(struct inet6_dev *idev) /* Should stop work after group drop. or we will * start work again in mld_ifc_event() */ - synchronize_net(); mld_query_stop_work(idev); mld_report_stop_work(idev); diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 2e5f3864d353..90e6bd2c3000 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -2530,7 +2530,7 @@ void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list) * netfilter framework. Roll on, two-stage module * delete... */ - synchronize_net(); + synchronize_rcu_expedited(); i_see_dead_people: busy = 0; list_for_each_entry(net, net_exit_list, exit_list) { |