go
go copied to clipboard
patch: runtime: TailscaleCurrentP
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
ts1.24: 320c0ca5f6ea8962485236714aa7093239a3adad