aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core/fib_notifier.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-03-29 13:47:54 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-29 13:47:54 -0400
commit038d49baab571800e3077b9d322a004f95c8aa8f (patch)
tree9bd5736d380f7c2f6f653671b52a5b206b158192 /net/core/fib_notifier.c
parentMerge branch 'net-bgmac-Couple-of-small-bgmac-changes' (diff)
parentnet: Remove rtnl_lock() in nf_ct_iterate_destroy() (diff)
downloadwireguard-linux-038d49baab571800e3077b9d322a004f95c8aa8f.tar.xz
wireguard-linux-038d49baab571800e3077b9d322a004f95c8aa8f.zip
Merge branch 'Introduce-net_rwsem-to-protect-net_namespace_list'
Kirill Tkhai says: ==================== Introduce net_rwsem to protect net_namespace_list The series introduces fine grained rw_semaphore, which will be used instead of rtnl_lock() to protect net_namespace_list. This improves scalability and allows to do non-exclusive sleepable iteration for_each_net(), which is enough for most cases. scripts/get_maintainer.pl gives enormous list of people, and I add all to CC. Note, that this patch is independent of "Close race between {un, }register_netdevice_notifier and pernet_operations": https://patchwork.ozlabs.org/project/netdev/list/?series=36495 Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/fib_notifier.c')
-rw-r--r--net/core/fib_notifier.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c
index 0c048bdeb016..614b985c92a4 100644
--- a/net/core/fib_notifier.c
+++ b/net/core/fib_notifier.c
@@ -33,6 +33,7 @@ static unsigned int fib_seq_sum(void)
struct net *net;
rtnl_lock();
+ down_read(&net_rwsem);
for_each_net(net) {
rcu_read_lock();
list_for_each_entry_rcu(ops, &net->fib_notifier_ops, list) {
@@ -43,6 +44,7 @@ static unsigned int fib_seq_sum(void)
}
rcu_read_unlock();
}
+ up_read(&net_rwsem);
rtnl_unlock();
return fib_seq;