linux/net/openvswitch
Kirill Tkhai f0b07bb151 net: Introduce net_rwsem to protect net_namespace_list
rtnl_lock() is used everywhere, and contention is very high.
When someone wants to iterate over alive net namespaces,
he/she has no a possibility to do that without exclusive lock.
But the exclusive rtnl_lock() in such places is overkill,
and it just increases the contention. Yes, there is already
for_each_net_rcu() in kernel, but it requires rcu_read_lock(),
and this can't be sleepable. Also, sometimes it may be need
really prevent net_namespace_list growth, so for_each_net_rcu()
is not fit there.

This patch introduces new rw_semaphore, which will be used
instead of rtnl_mutex to protect net_namespace_list. It is
sleepable and allows not-exclusive iterations over net
namespaces list. It allows to stop using rtnl_lock()
in several places (what is made in next patches) and makes
less the time, we keep rtnl_mutex. Here we just add new lock,
while the explanation of we can remove rtnl_lock() there are
in next patches.

Fine grained locks generally are better, then one big lock,
so let's do that with net_namespace_list, while the situation
allows that.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-29 13:47:53 -04:00
..
actions.c openvswitch: Add meter action support 2017-11-13 10:37:07 +09:00
conntrack.c openvswitch: Remove padding from packet before L3+ conntrack processing 2018-02-01 09:46:22 -05:00
conntrack.h openvswitch: add ct_clear action 2017-10-10 16:38:34 -07:00
datapath.c net: Introduce net_rwsem to protect net_namespace_list 2018-03-29 13:47:53 -04:00
datapath.h openvswitch: Add meter action support 2017-11-13 10:37:07 +09:00
dp_notify.c openvswitch: reliable interface indentification in port dumps 2017-11-05 21:49:17 +09:00
flow_netlink.c openvswitch: add erspan version I and II support 2018-01-25 21:39:43 -05:00
flow_netlink.h openvswitch: enable NSH support 2017-11-08 16:12:33 +09:00
flow_table.c openvswitch: Optimize operations for OvS flow_stats. 2017-07-19 13:49:39 -07:00
flow_table.h openvswitch: Zero flows on allocation. 2015-09-22 17:33:41 -07:00
flow.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-12-22 11:16:31 -05:00
flow.h openvswitch: enable NSH support 2017-11-08 16:12:33 +09:00
Kconfig openvswitch: enable NSH support 2017-11-08 16:12:33 +09:00
Makefile openvswitch: Add meter infrastructure 2017-11-13 10:37:07 +09:00
meter.c openvswitch: meter: fix the incorrect calculation of max delta_t 2018-03-11 22:48:59 -04:00
meter.h openvswitch: Add meter infrastructure 2017-11-13 10:37:07 +09:00
vport-geneve.c openvswitch: do not ignore netdev errors when creating tunnel vports 2016-08-10 23:13:23 -07:00
vport-gre.c openvswitch: do not ignore netdev errors when creating tunnel vports 2016-08-10 23:13:23 -07:00
vport-internal_dev.c net: ovs: remove unused hardirq.h 2018-01-08 20:59:25 -05:00
vport-internal_dev.h
vport-netdev.c net: Add extack to upper device linking 2017-10-04 21:39:33 -07:00
vport-netdev.h openvswitch: Use dev_queue_xmit for vport send. 2015-10-22 06:46:16 -07:00
vport-vxlan.c vxlan: get rid of redundant vxlan_dev.flags 2017-06-20 13:37:02 -04:00
vport.c openvswitch: fix vport packet length check. 2018-03-08 12:50:29 -05:00
vport.h openvswitch: pass mac_proto to ovs_vport_send 2016-11-13 00:51:02 -05:00