aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2023-08-01 13:54:32 -0400
committerGopher Robot <gobot@golang.org>2023-08-07 19:31:24 +0000
commitd367ec6a0ed0c016603c8aba697710a131a70db8 (patch)
tree8ef48f171120379983f416812f09889d84d8d1af /src/runtime/runtime2.go
parent6be2639aff73389fce845cd7a6d1c568a5ef5625 (diff)
downloadgo-d367ec6a0ed0c016603c8aba697710a131a70db8.tar.xz
runtime: move pcvalue cache to M
Currently, the pcvalue cache is stack allocated for each operation that needs to look up a lot of pcvalues. It's not always clear where to put it, a lot of the time we just pass a nil cache, it doesn't get reused across operations, and we put a surprising amount of effort into threading these caches around. This CL moves it to the M, where it can be long-lived and used by all pcvalue lookups, and we don't have to carefully thread it across operations. Change-Id: I675e583e0daac887c8ef77a402ba792648d96027 Reviewed-on: https://go-review.googlesource.com/c/go/+/515276 Run-TryBot: Austin Clements <austin@google.com> Auto-Submit: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 54fab050ea..e7db4dcdd7 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -611,6 +611,9 @@ type m struct {
// Whether this is a pending preemption signal on this M.
signalPending atomic.Uint32
+ // pcvalue lookup cache
+ pcvalueCache pcvalueCache
+
dlogPerM
mOS