]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add scavenge -> traceBuf to lock partial order
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 30 Apr 2020 19:13:41 +0000 (19:13 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 30 Apr 2020 20:18:38 +0000 (20:18 +0000)
Under the scavenge lock it's possible to ready a goroutine (or now
injectglist, which has mostly the same effect) which could cause an
unpark trace event to be emitted. If there's no active trace buffer for
the P, then we might acquire the lock. The total order between the two
is correct, but there's no partial order edge between them. Add in the
edge.

Change-Id: I3fc5d86a3b6bdd0b5648181fb76b5ebc90c3d69f
Reviewed-on: https://go-review.googlesource.com/c/go/+/231197
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/runtime/lockrank.go

index c2f061169a4c87e9a28ad4c5aa513ec8e7791705..05fff9579776004631672db356c7165d8a674bf6 100644 (file)
@@ -201,7 +201,7 @@ var lockPartialOrder [][]lockRank = [][]lockRank{
        lockRankHchan:         {lockRankScavenge, lockRankSweep, lockRankHchan},
        lockRankFin:           {lockRankSched, lockRankAllg, lockRankTimers, lockRankHchan},
        lockRankNotifyList:    {},
-       lockRankTraceBuf:      {},
+       lockRankTraceBuf:      {lockRankScavenge},
        lockRankTraceStrings:  {lockRankTraceBuf},
        lockRankMspanSpecial:  {lockRankScavenge, lockRankCpuprof, lockRankSched, lockRankAllg, lockRankAllp, lockRankTimers, lockRankItab, lockRankReflectOffs, lockRankHchan, lockRankNotifyList, lockRankTraceBuf, lockRankTraceStrings},
        lockRankProf:          {lockRankScavenge, lockRankAssistQueue, lockRankCpuprof, lockRankSweep, lockRankSched, lockRankAllg, lockRankAllp, lockRankTimers, lockRankItab, lockRankReflectOffs, lockRankNotifyList, lockRankTraceBuf, lockRankTraceStrings, lockRankHchan},