From a7befef034b5fcd7b19773e54b657bfd9ff99067 Mon Sep 17 00:00:00 2001 From: Jordan Whited Date: Tue, 10 Nov 2026 14:28:31 -0800 Subject: [PATCH] go.mod,wgengine/wgcfg: bump wg-go & configure staged global limit on iOS https://github.com/tailscale/wireguard-go/compare/79ead109a81a8f57c75ac9e6ddee61714c82744b...9e10ef9af41578baabde0283237d5cbb6422ff25 Start off with device.WithQueueStagedGlobalLimit inheriting the same value from the knob it replaced, device.WithPreallocatedBuffersPerPool. Unlike WithPreallocatedBuffersPerPool, WithQueueStagedGlobalLimit is exclusive of packet memory allocated for transport messages that are immediately transmitted. So, one must consider WithQueueStagedGlobalLimit alongside .Queue{In,Out}boundSize to understand overall memory ceiling impacts. An approximation of the configured packet memory ceiling on iOS can be calculated with the following formula: device.singlePacketSlabSize * ( // 1788 (2 * device.WithQueueOutboundSize) + // 128 (2 * device.WithQueueInboundSize) + // 128 device.WithQueueStagedGlobalLimit // 64 ) = ~572KB Where previously it was: device.singlePacketSlabSize * ( // 1788 device.WithPreallocatedBuffersPerPool // 64 ) = ~114KB Updates tailscale/tailscale#1971 Updates tailscale/tailscale#21773 Updates tailscale/corp#46396 Signed-off-by: Jordan Whited --- flake.nix | 2 +- flakehashes.json | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- shell.nix | 2 +- wgengine/wgcfg/mem_ios.go | 7 ++----- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 861c4a407..5b7ad03b6 100644 --- a/flake.nix +++ b/flake.nix @@ -173,4 +173,4 @@ }); }; } -# nix-direnv cache busting line: sha256-M7jMKZAikFtuHU7GZ1TBUme1cHrgKcg3LQObcXoXImU= +# nix-direnv cache busting line: sha256-Ackcupvrl5NqcyZZ7D3X3h/COrZ6Uz/rtxtzeu3ciU8= diff --git a/flakehashes.json b/flakehashes.json index b67f0e4fd..5d265606b 100644 --- a/flakehashes.json +++ b/flakehashes.json @@ -4,7 +4,7 @@ "sri": "sha256-sdlgTLTkdhTvGCeQTwAsR+Do8rNwBzBUp5QPc09BPgI=" }, "vendor": { - "goModSum": "sha256-fY5/kwYNwUr/WUhki7WhKxjO0u/PeBHY9iauefNCJvI=", - "sri": "sha256-M7jMKZAikFtuHU7GZ1TBUme1cHrgKcg3LQObcXoXImU=" + "goModSum": "sha256-ieea25MFXJHi9hzOR7vzPfxMPu8EKmsDnyqCXhdiiCU=", + "sri": "sha256-Ackcupvrl5NqcyZZ7D3X3h/COrZ6Uz/rtxtzeu3ciU8=" } } diff --git a/go.mod b/go.mod index f3ea023fc..bc72a9d1d 100644 --- a/go.mod +++ b/go.mod @@ -126,7 +126,7 @@ require ( github.com/tailscale/ts-gokrazy v0.0.0-20260630224145-b83088f2e52e github.com/tailscale/web-client-prebuilt v0.0.0-20260917222731-e0ed2d0d0fea github.com/tailscale/wf v0.0.0-20240214030419-6fbb0a674ee6 - github.com/tailscale/wireguard-go v0.0.0-20261105205217-79ead109a81a + github.com/tailscale/wireguard-go v0.0.0-20261110220948-9e10ef9af415 github.com/tailscale/xnet v0.0.0-20240729143630-8497ac4dab2e github.com/tc-hib/winres v0.3.1 github.com/tcnksm/go-httpstat v0.2.0 diff --git a/go.sum b/go.sum index 7c478349c..26e5670eb 100644 --- a/go.sum +++ b/go.sum @@ -1154,8 +1154,8 @@ github.com/tailscale/web-client-prebuilt v0.0.0-20260917222731-e0ed2d0d0fea h1:a github.com/tailscale/web-client-prebuilt v0.0.0-20260917222731-e0ed2d0d0fea/go.mod h1:agQPE6y6ldqCOui2gkIh7ZMztTkIQKH049tv8siLuNQ= github.com/tailscale/wf v0.0.0-20240214030419-6fbb0a674ee6 h1:l10Gi6w9jxvinoiq15g8OToDdASBni4CyJOdHY1Hr8M= github.com/tailscale/wf v0.0.0-20240214030419-6fbb0a674ee6/go.mod h1:ZXRML051h7o4OcI0d3AaILDIad/Xw0IkXaHM17dic1Y= -github.com/tailscale/wireguard-go v0.0.0-20261105205217-79ead109a81a h1:bxmkuenopCCc4jbWxUkZ26NZHq4sYdfPdVNB2XX+nV8= -github.com/tailscale/wireguard-go v0.0.0-20261105205217-79ead109a81a/go.mod h1:rUelGmuK4UnSJYM5gl5Mknp6YbwwcL8+VAPMhNYe+jg= +github.com/tailscale/wireguard-go v0.0.0-20261110220948-9e10ef9af415 h1:/C32PSOxVVL2ZIWN/iNNY4+5sSb7yM/OwFteAIeGeoU= +github.com/tailscale/wireguard-go v0.0.0-20261110220948-9e10ef9af415/go.mod h1:rUelGmuK4UnSJYM5gl5Mknp6YbwwcL8+VAPMhNYe+jg= github.com/tailscale/xnet v0.0.0-20240729143630-8497ac4dab2e h1:zOGKqN5D5hHhiYUp091JqK7DPCqSARyUfduhGUY8Bek= github.com/tailscale/xnet v0.0.0-20240729143630-8497ac4dab2e/go.mod h1:orPd6JZXXRyuDusYilywte7k094d7dycXXU5YnWsrwg= github.com/tc-hib/winres v0.3.1 h1:CwRjEGrKdbi5CvZ4ID+iyVhgyfatxFoizjPhzez9Io4= diff --git a/shell.nix b/shell.nix index ec502619e..1fee10843 100644 --- a/shell.nix +++ b/shell.nix @@ -16,4 +16,4 @@ ) { src = ./.; }).shellNix -# nix-direnv cache busting line: sha256-M7jMKZAikFtuHU7GZ1TBUme1cHrgKcg3LQObcXoXImU= +# nix-direnv cache busting line: sha256-Ackcupvrl5NqcyZZ7D3X3h/COrZ6Uz/rtxtzeu3ciU8= diff --git a/wgengine/wgcfg/mem_ios.go b/wgengine/wgcfg/mem_ios.go index ecd4de36a..db4b40956 100644 --- a/wgengine/wgcfg/mem_ios.go +++ b/wgengine/wgcfg/mem_ios.go @@ -13,15 +13,12 @@ func getMemoryOptions() []device.Option { // avoid getting killed. // // See _notios.go for a longer explanation of what the Queue{In,Out}boundSize - // knobs control and the tradeoffs involved. Eventually Queue{In,Out}boundSize - // should be CPU-scaled, and WithPreallocated... removed, but we keep them all - // static for now, until the [device.WaitPool] ceiling is eliminated. - // (See tailscale/corp#46396). + // knobs control and the tradeoffs involved. return []device.Option{ device.WithQueueStagedSize(64), device.WithQueueOutboundSize(64), device.WithQueueInboundSize(64), device.WithQueueHandshakeSize(64), - device.WithPreallocatedBuffersPerPool(64), + device.WithQueueStagedGlobalLimit(64), } }