]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: perform gcMarkRootCheck during STW in checkmark mode
authorAustin Clements <austin@google.com>
Mon, 14 Mar 2016 17:51:23 +0000 (13:51 -0400)
committerAustin Clements <austin@google.com>
Wed, 16 Mar 2016 20:12:59 +0000 (20:12 +0000)
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>

src/runtime/mgc.go

index 41c53c3c13f16e8e9a6443ae5965c369630f8dfd..2b1e56a5f0f3d6994144211ef9d8c25a1d499f47 100644 (file)
@@ -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")
        }