Skip to content

Commit

Permalink
runtime: move trace locks to the leaf of the lock graph
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Michael Pratt <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
aclements committed Aug 11, 2022
1 parent 6c2e327 commit cc8bac8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
24 changes: 12 additions & 12 deletions src/runtime/lockrank.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions src/runtime/mklockrank.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,15 @@ allg,
MPROF < profInsert, profBlock, profMemActive;
profMemActive < profMemFuture;
# Execution tracer events (with a P)
hchan,
root,
sched,
traceStrings,
notifyList,
fin
# Above TRACE is anything that can create a trace event
< TRACE
< trace
< traceStackTab;
# Stack allocation and copying
gcBitsArenas,
netpollInit,
profBlock,
profInsert,
profMemFuture,
spanSetSpine,
traceStackTab
fin,
root
# Anything that can grow the stack can acquire STACKGROW.
# (Most higher layers imply STACKGROW, like MALLOC.)
< STACKGROW
Expand Down Expand Up @@ -168,6 +157,18 @@ stackLarge,
# Below mheap is the span allocator implementation.
mheap, mheapSpecial < globalAlloc;
# Execution tracer events (with a P)
hchan,
root,
sched,
traceStrings,
notifyList,
fin
# Above TRACE is anything that can create a trace event
< TRACE
< trace
< traceStackTab;
# panic is handled specially. It is implicitly below all other locks.
NONE < panic;
# deadlock is not acquired while holding panic, but it also needs to be
Expand Down

0 comments on commit cc8bac8

Please sign in to comment.