summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-03-29 20:47:54 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-29 20:47:54 +0300
commit038d49baab571800e3077b9d322a004f95c8aa8f (patch)
tree9bd5736d380f7c2f6f653671b52a5b206b158192 /include
parent906edee91e79af5a348f1ad1b3f9b4b948db3db7 (diff)
parent152f253152cc08f5d26ba76659723d2d83b363f8 (diff)
downloadlinux-038d49baab571800e3077b9d322a004f95c8aa8f.tar.xz
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 'include')
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/net/net_namespace.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index c7d1e4689325..5225832bd6ff 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -37,6 +37,7 @@ extern int rtnl_lock_killable(void);
extern wait_queue_head_t netdev_unregistering_wq;
extern struct rw_semaphore pernet_ops_rwsem;
+extern struct rw_semaphore net_rwsem;
#ifdef CONFIG_PROVE_LOCKING
extern bool lockdep_rtnl_is_held(void);
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 1ab4f920f109..47e35cce3b64 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -291,6 +291,7 @@ static inline struct net *read_pnet(const possible_net_t *pnet)
#endif
}
+/* Protected by net_rwsem */
#define for_each_net(VAR) \
list_for_each_entry(VAR, &net_namespace_list, list)