Skip to content

Commit

Permalink
net: use synchronize_rcu_expedited in cleanup_net()
Browse files Browse the repository at this point in the history
cleanup_net() is calling synchronize_rcu() right before
acquiring RTNL.

synchronize_rcu() is much slower than synchronize_rcu_expedited(),
and cleanup_net() is currently single threaded. In many workloads
we want cleanup_net() to be fast, in order to free memory and various
sysfs and procfs entries as fast as possible.

Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Feb 12, 2024
1 parent 2cd0c51 commit 78c3253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 78c3253

Please sign in to comment.