net: Kill net_mutex

We take net_mutex, when there are !async pernet_operations
registered, and read locking of net_sem is not enough. But
we may get rid of taking the mutex, and just change the logic
to write lock net_sem in such cases. This obviously reduces
the number of lock operations, we do.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kirill Tkhai
2018-02-19 12:58:38 +03:00
committed by David S. Miller
parent ffc385b95a
commit 19efbd93e6
3 changed files with 39 additions and 26 deletions

View File

@@ -35,7 +35,6 @@ extern int rtnl_trylock(void);
extern int rtnl_is_locked(void);
extern wait_queue_head_t netdev_unregistering_wq;
extern struct mutex net_mutex;
extern struct rw_semaphore net_sem;
#ifdef CONFIG_PROVE_LOCKING