mirror of
https://github.com/golang/go.git
synced 2025-05-28 19:02:22 +00:00
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: Rick Hudson <rlh@golang.org>
This commit is contained in:
parent
1678b2c580
commit
143b13ae82
@ -1905,29 +1905,13 @@ func gcMark(start_time int64) {
|
||||
work.nwait = 0
|
||||
work.ndone = 0
|
||||
work.nproc = uint32(gcprocs())
|
||||
|
||||
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 {
|
||||
|
||||
// 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")
|
||||
}
|
||||
work.helperDrainBlock = true
|
||||
}
|
||||
|
||||
if work.nproc > 1 {
|
||||
noteclear(&work.alldone)
|
||||
|
Loading…
x
Reference in New Issue
Block a user