aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-03-27 17:01:53 -0400
committerAustin Clements <austin@google.com>2015-04-27 19:26:37 +0000
commitbb6320535d6bcef1a5d44cb7429877166c4d5298 (patch)
tree0827c278158213a567ed818ed52ad8082f1e68be /src/runtime/runtime2.go
parent57afa76471ccb3fd9e92349825f90b6c354fc9b5 (diff)
downloadgo-bb6320535d6bcef1a5d44cb7429877166c4d5298.tar.xz
runtime: replace STW for enabling write barriers with ragged barrier
Currently, we use a full stop-the-world around enabling write barriers. This is to ensure that all Gs have enabled write barriers before any blackening occurs (either in gcBgMarkWorker() or in gcAssistAlloc()). However, there's no need to bring the whole world to a synchronous stop to ensure this. This change replaces the STW with a ragged barrier that ensures each P has individually observed that write barriers should be enabled before GC performs any blackening. Change-Id: If2f129a6a55bd8bdd4308067af2b739f3fb41955 Reviewed-on: https://go-review.googlesource.com/8207 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index e4ac804b71..04ed059e19 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -533,6 +533,11 @@ type forcegcstate struct {
var gcphase uint32
+// gcBlackenEnabled is 1 if mutator assists and background mark
+// workers are allowed to blacken objects. This must only be set when
+// gcphase == _GCmark.
+var gcBlackenEnabled uint32
+
/*
* known to compiler
*/