Skip to content

Commit

Permalink
runtime: fix lockrank ordering for pinner implementation
Browse files Browse the repository at this point in the history
The new Pinner API's implementation imposes some partial-orders that are
safe but previously did not exist between a mspanSpecial, mheapSpecial,
and mheap. Fix that up in the lock ranking.

For #46787.

Change-Id: I51cc8f7f069240caeb44d749bed43515634f4814
Reviewed-on: https://go-review.googlesource.com/c/go/+/496193
Run-TryBot: Michael Knyszek <[email protected]>
Reviewed-by: David Chase <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Auto-Submit: Michael Knyszek <[email protected]>
  • Loading branch information
mknyszek authored and gopherbot committed May 19, 2023
1 parent f283cba commit 78df00d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/runtime/lockrank.go

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

8 changes: 6 additions & 2 deletions src/runtime/mklockrank.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ allg,
# Below MALLOC is the malloc implementation.
< fin,
gcBitsArenas,
mheapSpecial,
mspanSpecial,
spanSetSpine,
mspanSpecial,
MPROF;
# Memory profiling
Expand Down Expand Up @@ -159,6 +158,11 @@ stackLarge,
# Above mheap is anything that can call the span allocator.
< mheap;
# Below mheap is the span allocator implementation.
#
# Specials: we're allowed to allocate a special while holding
# an mspanSpecial lock, and they're part of the malloc implementation.
# Pinner bits might be freed by the span allocator.
mheap, mspanSpecial < mheapSpecial;
mheap, mheapSpecial < globalAlloc;
# Execution tracer events (with a P)
Expand Down

0 comments on commit 78df00d

Please sign in to comment.