Skip to content

Commit cc8bac8

Browse files
committed
runtime: move trace locks to the leaf of the lock graph
Now that trace.lock cannot be held over a stack split, we can move that lock and traceStackTab to the leaf of the lock graph. We add a couple edges to STACKGROW that were previously passing through trace. Fixes #53979. Change-Id: Ie664ff7bb33973745f991f7516dc6106e60f5892 Reviewed-on: https://go-review.googlesource.com/c/go/+/418957 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
1 parent 6c2e327 commit cc8bac8

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

Diff for: src/runtime/lockrank.go

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/runtime/mklockrank.go

+14-13
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,15 @@ allg,
115115
MPROF < profInsert, profBlock, profMemActive;
116116
profMemActive < profMemFuture;
117117
118-
# Execution tracer events (with a P)
119-
hchan,
120-
root,
121-
sched,
122-
traceStrings,
123-
notifyList,
124-
fin
125-
# Above TRACE is anything that can create a trace event
126-
< TRACE
127-
< trace
128-
< traceStackTab;
129-
130118
# Stack allocation and copying
131119
gcBitsArenas,
132120
netpollInit,
133121
profBlock,
134122
profInsert,
135123
profMemFuture,
136124
spanSetSpine,
137-
traceStackTab
125+
fin,
126+
root
138127
# Anything that can grow the stack can acquire STACKGROW.
139128
# (Most higher layers imply STACKGROW, like MALLOC.)
140129
< STACKGROW
@@ -168,6 +157,18 @@ stackLarge,
168157
# Below mheap is the span allocator implementation.
169158
mheap, mheapSpecial < globalAlloc;
170159
160+
# Execution tracer events (with a P)
161+
hchan,
162+
root,
163+
sched,
164+
traceStrings,
165+
notifyList,
166+
fin
167+
# Above TRACE is anything that can create a trace event
168+
< TRACE
169+
< trace
170+
< traceStackTab;
171+
171172
# panic is handled specially. It is implicitly below all other locks.
172173
NONE < panic;
173174
# deadlock is not acquired while holding panic, but it also needs to be

0 commit comments

Comments
 (0)