aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2016-03-14 13:51:23 -0400
committerAustin Clements <austin@google.com>2016-03-16 20:12:59 +0000
commitd7cedc4b74f902a3a1b429fb27f85380f6955a6f (patch)
tree26d4b2480534e08fd312d5c6ca6487e85e2b0cb1 /src/runtime
parenta96884cf6c76a5d409ec4b193b6cc52534b80bad (diff)
downloadgo-d7cedc4b74f902a3a1b429fb27f85380f6955a6f.tar.xz
runtime: perform gcMarkRootCheck during STW in checkmark mode
gcMarkRootCheck is too expensive to do during mark termination. However, since it's a useful check and it complements checkmark mode nicely, enable it during mark termination is checkmark is enabled. Change-Id: Icd9039e85e6e9d22747454441b50f1cdd1412202 Reviewed-on: https://go-review.googlesource.com/20663 Reviewed-by: Rick Hudson <rlh@golang.org> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/mgc.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go
index 41c53c3c13..2b1e56a5f0 100644
--- a/src/runtime/mgc.go
+++ b/src/runtime/mgc.go
@@ -1554,8 +1554,11 @@ func gcMark(start_time int64) {
gcDrain(gcw, gcDrainBlock)
gcw.dispose()
- // TODO: Re-enable once this is cheap.
- //gcMarkRootCheck()
+ if debug.gccheckmark > 0 {
+ // This is expensive when there's a large number of
+ // Gs, so only do it if checkmark is also enabled.
+ gcMarkRootCheck()
+ }
if work.full != 0 {
throw("work.full != 0")
}