]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: drop redundant gcBlackenEnabled reset
authorMichael Pratt <mpratt@google.com>
Tue, 7 Jul 2020 21:55:40 +0000 (17:55 -0400)
committerMichael Pratt <mpratt@google.com>
Fri, 23 Oct 2020 21:26:40 +0000 (21:26 +0000)
This reset of gcBlackenEnabled is a no-op because it was already reset
almost immediately before in gcMarkDone, which is the only caller of
gcMarkTermination.

Adjust the comment to clarify setGCPhase a bit more. We are coming from
_GCmark, so write barriers are already enabled.

Change-Id: Ieac2dadf33c3c5a44e8a25a499dea8cfe03b8d73
Reviewed-on: https://go-review.googlesource.com/c/go/+/241357
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/mgc.go

index 65ac654b1429da69d4973f3de1ffb88f4fd877cc..c42c7fbd297ae1a9b309a430458902ae487c4ec8 100644 (file)
@@ -1558,10 +1558,10 @@ top:
        gcMarkTermination(nextTriggerRatio)
 }
 
+// World must be stopped and mark assists and background workers must be
+// disabled.
 func gcMarkTermination(nextTriggerRatio float64) {
-       // World is stopped.
-       // Start marktermination which includes enabling the write barrier.
-       atomic.Store(&gcBlackenEnabled, 0)
+       // Start marktermination (write barrier remains enabled for now).
        setGCPhase(_GCmarktermination)
 
        work.heap1 = memstats.heap_live