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
..
2018-02-14 09:43:22 -08:00
2018-01-31 12:25:27 -08:00
2018-02-01 09:51:57 -08:00
2018-03-14 18:31:04 +00:00
2018-02-02 14:19:19 -08:00
2018-03-26 13:47:13 -07:00
2018-01-18 09:08:56 +01:00
2018-01-29 09:58:36 +01:00
2018-03-11 21:24:29 +01:00
2018-02-20 11:34:54 +00:00
2018-02-03 12:10:09 -08:00
2018-02-06 15:30:52 -08:00
2018-01-26 14:43:55 +00:00
2018-02-22 10:45:46 -08:00
2018-02-01 16:35:31 -08:00
2018-02-09 14:55:30 -08:00
2018-03-06 09:17:34 -08:00
2018-02-12 10:41:11 +01:00
2018-02-06 22:54:15 +00:00
2018-02-14 11:55:33 -05:00
2018-01-18 11:56:49 +01:00
2018-03-01 08:41:25 -07:00
2018-02-06 18:32:44 -08:00
2018-01-30 20:18:28 -07:00
2018-02-15 08:27:06 -07:00
2018-03-19 21:14:38 +01:00
2018-02-23 16:23:11 +01:00
2018-03-19 21:14:38 +01:00
2018-02-04 11:16:35 -08:00
2018-02-06 18:32:46 -08:00
2018-03-14 12:53:23 -04:00
2018-01-26 16:43:32 -08:00
2018-03-08 10:03:12 -08:00
2018-02-20 11:17:58 +01:00
2018-02-26 09:34:21 -08:00
2018-02-21 15:35:43 -08:00
2018-02-08 10:21:39 +01:00
2018-02-02 09:50:51 -08:00
2018-02-15 12:01:53 +01:00
2018-02-16 10:40:24 +01:00
2018-02-06 18:32:47 -08:00
2018-02-06 18:32:47 -08:00
2018-01-24 11:25:59 +01:00
2018-01-29 13:44:54 -05:00
2018-02-03 12:10:09 -08:00
2018-02-12 15:59:08 +00:00
2018-01-31 13:12:31 -08:00
2018-01-18 12:54:41 -07:00
2018-02-08 15:13:30 -05:00
2018-03-08 21:54:52 -05:00
2018-01-25 14:10:39 -08:00
2018-02-07 13:10:43 -08:00
2018-01-30 21:54:32 +01:00
2018-03-19 21:14:38 +01:00
2018-03-15 18:57:14 -07:00
2018-01-29 09:08:34 -08:00
2018-02-12 10:41:11 +01:00
2018-02-26 09:48:42 -07:00
2018-02-06 18:32:46 -08:00
2018-01-31 17:18:40 -08:00
2018-02-06 16:41:29 -05:00
2018-02-22 21:13:03 +01:00
2018-03-09 12:02:59 -05:00
2018-03-16 10:03:47 -04:00
2018-01-24 19:13:45 -05:00
2018-02-20 11:17:58 +01:00
2018-02-06 18:32:47 -08:00
2018-01-29 09:08:34 -08:00
2018-02-01 08:15:25 -05:00
2018-02-21 16:54:05 +01:00
2018-02-06 18:32:45 -08:00
2018-02-06 18:32:43 -08:00
2018-02-22 10:45:46 -08:00
2018-02-13 09:15:58 +01:00
2018-02-21 16:54:06 +01:00
2018-02-24 01:43:47 +01:00
2018-02-01 15:01:15 -07:00
2018-01-30 10:44:56 -08:00
2018-02-06 18:32:47 -08:00
2018-03-22 17:07:01 -07:00
2018-02-21 15:35:42 -08:00
2018-02-13 16:25:06 +01:00
2018-01-31 17:18:38 -08:00
2018-02-06 10:41:33 -08:00
2018-01-31 17:18:38 -08:00
2018-01-31 17:18:39 -08:00
2018-02-06 18:32:47 -08:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-02-21 08:56:40 +01:00
2018-01-19 14:53:32 -05:00
2018-03-23 11:31:58 -04:00
2018-03-26 11:34:00 -04:00
2018-02-17 08:40:59 +01:00
2018-01-28 22:17:24 -05:00
2018-02-01 10:57:45 -08:00
2018-03-05 18:03:20 -06:00
2018-02-01 10:57:45 -08:00
2018-01-31 17:18:40 -08:00
2018-01-31 17:18:37 -08:00
2018-01-28 15:49:06 -06:00
2018-02-08 15:32:25 -05:00
2018-01-28 15:48:29 -06:00
2018-01-28 15:48:29 -06:00
2018-02-01 11:40:07 -06:00
2018-01-28 15:48:29 -06:00
2018-02-06 09:59:40 -08:00
2018-03-19 10:09:44 -07:00
2018-01-19 16:50:53 -08:00
2018-03-23 11:31:58 -04:00
2018-02-06 18:32:47 -08:00
2018-02-11 14:37:22 -08:00
2018-02-12 10:41:11 +01:00
2018-02-06 22:54:11 +00:00
2018-02-14 14:33:36 -05:00
2018-02-19 18:46:11 -05:00
2018-02-06 16:41:28 -05:00
2018-02-01 10:31:17 -08:00
2018-03-07 10:44:02 -05:00
2018-03-29 13:47:53 -04:00
2018-01-29 10:59:24 -08:00
2018-01-19 12:31:03 -07:00
2018-02-06 22:15:42 -08:00
2018-02-11 14:34:03 -08:00
2018-02-13 15:00:06 +01:00
2018-02-07 12:50:21 +02:00
2018-02-01 09:46:00 -08:00
2018-02-09 09:44:25 -08:00
2018-02-28 11:07:11 -05:00
2018-01-31 17:18:39 -08:00
2018-01-29 12:02:54 -05:00
2018-03-23 11:31:58 -04:00
2018-03-19 21:14:38 +01:00
2018-01-18 11:56:49 +01:00
2018-01-31 09:25:20 -08:00
2018-02-07 12:18:23 +01:00
2018-02-21 15:35:42 -08:00
2018-01-21 17:44:47 -08:00
2018-02-06 09:59:40 -08:00
2018-02-05 21:34:50 +01:00
2018-02-06 18:32:47 -08:00
2018-01-25 16:41:14 -08:00
2018-02-28 13:21:10 +01:00
2018-03-07 11:46:39 -05:00
2018-02-06 18:32:44 -08:00
2018-01-24 09:00:05 -08:00
2018-01-31 17:18:37 -08:00
2018-03-13 13:37:42 -07:00
2018-01-31 17:18:39 -08:00