Commit 143b13ae authored by Austin Clements's avatar Austin Clements

runtime: clean up remaining mark work check

Now that STW GC marking is unified with concurrent marking, there
should never be mark work remaining in mark termination. Hence, we can
make that check unconditional.

Updates #26903. This is a follow-up to unifying STW GC and concurrent GC.

Change-Id: I43a21df5577635ab379c397a7405ada68d331e03
Reviewed-on: https://go-review.googlesource.com/c/134781
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRick Hudson <rlh@golang.org>
parent 1678b2c5
......@@ -1905,28 +1905,12 @@ func gcMark(start_time int64) {
work.nwait = 0
work.ndone = 0
work.nproc = uint32(gcprocs())
work.helperDrainBlock = false
if work.full == 0 && work.nDataRoots+work.nBSSRoots+work.nSpanRoots+work.nStackRoots == 0 {
// There's no work on the work queue and no root jobs
// that can produce work, so don't bother entering the
// getfull() barrier. There will be flushCacheRoots
// work, but that doesn't gray anything.
//
// This should always be the situation after
// concurrent mark.
work.helperDrainBlock = false
} else {
// There's marking work to do. This is the case during
// STW GC. Instruct GC workers
// to block in getfull until all GC workers are in getfull.
//
// TODO(austin): Move STW marking out of
// mark termination and eliminate this code path.
if debug.gcstoptheworld == 0 {
print("runtime: full=", hex(work.full), " nDataRoots=", work.nDataRoots, " nBSSRoots=", work.nBSSRoots, " nSpanRoots=", work.nSpanRoots, " nStackRoots=", work.nStackRoots, "\n")
panic("non-empty mark queue after concurrent mark")
}
work.helperDrainBlock = true
// Check that there's no marking work remaining.
if work.full != 0 || work.nDataRoots+work.nBSSRoots+work.nSpanRoots+work.nStackRoots != 0 {
print("runtime: full=", hex(work.full), " nDataRoots=", work.nDataRoots, " nBSSRoots=", work.nBSSRoots, " nSpanRoots=", work.nSpanRoots, " nStackRoots=", work.nStackRoots, "\n")
panic("non-empty mark queue after concurrent mark")
}
if work.nproc > 1 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment