go icon indicating copy to clipboard operation
go copied to clipboard

patch: runtime: TailscaleCurrentP

Open bradfitz opened this issue 11 months ago • 1 comments

For https://github.com/tailscale/tailscale/pull/14412 for sharded counters that have high write load, we want a ~"current CPU" hint, even if it's outdated by the time we use it.

+func TailscaleCurrentP() int {
+       return int(getg().m.p.ptr().id)
+}

Commit 161c3b79ed91039e65eb148f2547dea6b91e2247

/cc @raggi

bradfitz avatar Dec 18 '24 16:12 bradfitz

ts1.24: 320c0ca5f6ea8962485236714aa7093239a3adad

bradfitz avatar Feb 13 '25 19:02 bradfitz