diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-05-19 13:45:49 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-05-19 18:37:54 +0200 |
commit | ab7e4abe1cd867362dc403a04a32028e8d62e1e9 (patch) | |
tree | 3a5a1f80013831f33b06a962aa2100bc3de86c2a /drivers/net/wireguard/Makefile | |
parent | ba1d3e59fcdadf0c72fb44f5385ef6e0af849351 (diff) | |
download | wireguard-linux-trimmed-jd/deferred-aip-removal.tar.gz wireguard-linux-trimmed-jd/deferred-aip-removal.zip |
wireguard: allowedips: batch process peer removalsjd/deferred-aip-removal
Deleting peers requires traversing the entire trie in order to rebalance
nodes and safely free them so that we can use RCU in the critical path
and never block. But for a structure filled with half million nodes,
removing a few thousand of them can take an extremely long time, during
which we're holding the rtnl lock. Large-scale users were reporting
200ms latencies added to the networking stack as a whole every time
their userspace software would queue up significant removals.
This commit works around the problem by marking nodes as dead, and then
scheduling a deferred cleanup routine a second later to do one sweep of
the entire structure, in order to amortize removals to just a single
traversal. Not only should this remove the added latencies to the stack,
but it should also make update operations that include peer removal or
allowedips changes much faster.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'drivers/net/wireguard/Makefile')
0 files changed, 0 insertions, 0 deletions