< sched;
sched < allg, allp;
allp < timers;
+timers < wakeableSleep;
timers < netpollInit;
# Channels
< itab
< reflectOffs;
+# User arena state
+NONE < userArenaState;
+
# Tracing without a P uses a global trace buffer.
scavenge
# Above TRACEGLOBAL can emit a trace event without a P.
notifyList,
reflectOffs,
timers,
- traceStrings
+ traceStrings,
+ userArenaState
# Above MALLOC are things that can allocate memory.
< MALLOC
# Below MALLOC is the malloc implementation.
< fin,
- gcBitsArenas,
- mheapSpecial,
- mspanSpecial,
spanSetSpine,
+ mspanSpecial,
MPROF;
+# We can acquire gcBitsArenas for pinner bits, and
+# it's guarded by mspanSpecial.
+MALLOC, mspanSpecial < gcBitsArenas;
+
# Memory profiling
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,
profInsert,
profMemFuture,
spanSetSpine,
- traceStackTab
+ fin,
+ root
# Anything that can grow the stack can acquire STACKGROW.
# (Most higher layers imply STACKGROW, like MALLOC.)
< STACKGROW
# 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)
+hchan,
+ mheap,
+ 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
# below all other locks.
panic < deadlock;
+# raceFini is only held while exiting.
+panic < raceFini;
`
// cyclicRanks lists lock ranks that allow multiple locks of the same