diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-05-19 17:55:51 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2021-07-23 02:44:46 +0300 |
commit | f911325706b63033183dacb76f6abb2060dae01a (patch) | |
tree | d1b9ea44b8409a897ccf857cc7b695230902cb28 /drivers/net/wireguard/socket.c | |
parent | 5d4bd7e6644025f68d451171e11664e28a13b25d (diff) |
global: use synchronize_net rather than synchronize_rcu
Many of the synchronization points are sometimes called under the rtnl
lock, which means we should use synchronize_net rather than
synchronize_rcu. Under the hood, this expands to using the expedited
flavor of function in the event that rtnl is held, in order to not stall
other concurrent changes.
This fixes some very, very long delays when removing multiple peers at
once, which would cause some operations to take several minutes.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Change-Id: I0801d60862f1272ed01b8f3ab2592001d5325a35
Diffstat (limited to 'drivers/net/wireguard/socket.c')
-rw-r--r-- | drivers/net/wireguard/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireguard/socket.c b/drivers/net/wireguard/socket.c index e8eceeb0b62a..04739763e303 100644 --- a/drivers/net/wireguard/socket.c +++ b/drivers/net/wireguard/socket.c @@ -430,7 +430,7 @@ void wg_socket_reinit(struct wg_device *wg, struct sock *new4, if (new4) wg->incoming_port = ntohs(inet_sk(new4)->inet_sport); mutex_unlock(&wg->socket_update_lock); - synchronize_rcu(); + synchronize_net(); sock_free(old4); sock_free(old6); } |