mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-20 16:51:18 -08:00
The encrypt workers freed each list's original packets as soon as they were encrypted. For TCP, freeing releases the socket's small queues accounting (tcp_wfree), whose TSQ handlers then ran on all the encrypt workers' CPUs at once and contended for the socket lock (about 5% of each sender CPU in queued_spin_lock_slowpath). Free them instead on the peer's tx worker once their encrypted packets are sent, which is also when upstream releases them. Bulk TCP in the lean harness (medians of interleaved runs): 1 stream 10.4 Gbps (wireguard-go 10.0), 4 streams 12.7 Gbps (wireguard-go 11.1). Updates #426 Signed-off-by: Brad Fitzpatrick <[email protected]> Change-Id: I904dea12ccfd7bc0534d616eb319fd692eefd832