diff --git a/flake.nix b/flake.nix index a5e0d6828..e0c899fe5 100644 --- a/flake.nix +++ b/flake.nix @@ -173,4 +173,4 @@ }); }; } -# nix-direnv cache busting line: sha256-dw6GW+nyFutqH+a+/qYbij920uHOdEWrTG0B6T3esWY= +# nix-direnv cache busting line: sha256-AeOJeTGIk14FbhP5kPXRiaNHUYm7KP01F/Mx/yoheuo= diff --git a/flakehashes.json b/flakehashes.json index 474823496..a47ae8c36 100644 --- a/flakehashes.json +++ b/flakehashes.json @@ -4,7 +4,7 @@ "sri": "sha256-Up4oMG6TVLQkV9inAYF3uYbxu+bMHeU7q9BLcXIllow=" }, "vendor": { - "goModSum": "sha256-HNO+xNC4DTJFJpetpslu3Wif8SChTWCxq32mZ8UkiBE=", - "sri": "sha256-dw6GW+nyFutqH+a+/qYbij920uHOdEWrTG0B6T3esWY=" + "goModSum": "sha256-mv93TCMisvb7pystEF5p+6NM4y8eMAxwTNxzjHByOGg=", + "sri": "sha256-AeOJeTGIk14FbhP5kPXRiaNHUYm7KP01F/Mx/yoheuo=" } } diff --git a/go.mod b/go.mod index dc44f5380..5b56bb02f 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-20261110220948-9e10ef9af415 + github.com/tailscale/wireguard-go v0.0.0-20261116233941-c90940ef3f06 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 84670bb62..01ce9e9aa 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-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/wireguard-go v0.0.0-20261116233941-c90940ef3f06 h1:F/qY0CU5GQY0ecxAWIvWu8oIwXfgChQsec+LJZfY5N4= +github.com/tailscale/wireguard-go v0.0.0-20261116233941-c90940ef3f06/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 ba9b5790f..5264c0589 100644 --- a/shell.nix +++ b/shell.nix @@ -16,4 +16,4 @@ ) { src = ./.; }).shellNix -# nix-direnv cache busting line: sha256-dw6GW+nyFutqH+a+/qYbij920uHOdEWrTG0B6T3esWY= +# nix-direnv cache busting line: sha256-AeOJeTGIk14FbhP5kPXRiaNHUYm7KP01F/Mx/yoheuo= diff --git a/wgengine/wgcfg/mem_notios.go b/wgengine/wgcfg/mem_notios.go index b0a0d7eff..1af0586d1 100644 --- a/wgengine/wgcfg/mem_notios.go +++ b/wgengine/wgcfg/mem_notios.go @@ -27,17 +27,16 @@ func getMemoryOptions() []device.Option { // // Small queues park I/O goroutines and hurt throughput; large queues allow // more packet batches and their associated memory to remain outstanding. We - // have to find a balance. Crypto goroutines are sized to [runtime.NumCPU] - // in wireguard-go, so we start there, and apply a benchmark-backed scaling - // factor to reduce head I/O goroutines parking around bursts. + // have to find a balance. Crypto goroutines are sized to cgroup-aware + // [runtime.GOMAXPROCS] in wireguard-go, so we start there, and apply a + // benchmark-backed scaling factor to reduce head I/O goroutines parking + // around bursts. const cpuScalingFactor = 4 // maxQueueSize was the previous static default, prior to creation of the // [device.Option]. const maxQueueSize = 1024 return []device.Option{ - // TODO: make cgroup-aware with runtime.GOMAXPROCS(0). - // See tailscale/corp#47966. - device.WithQueueInboundSize(min(maxQueueSize, runtime.NumCPU()*cpuScalingFactor)), - device.WithQueueOutboundSize(min(maxQueueSize, runtime.NumCPU()*cpuScalingFactor)), + device.WithQueueInboundSize(min(maxQueueSize, runtime.GOMAXPROCS(0)*cpuScalingFactor)), + device.WithQueueOutboundSize(min(maxQueueSize, runtime.GOMAXPROCS(0)*cpuScalingFactor)), } }