From db185e543fe471c522790b7d93291e786dc54a84 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 7 Jul 2020 17:55:40 -0400 Subject: [PATCH] runtime: drop redundant gcBlackenEnabled reset 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 TryBot-Result: Go Bot Trust: Michael Pratt Reviewed-by: Michael Knyszek --- src/runtime/mgc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 65ac654b14..c42c7fbd29 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -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 -- 2.50.0