]> Cypherpunks repositories - gostls13.git/commit
runtime: replace STW for enabling write barriers with ragged barrier
authorAustin Clements <austin@google.com>
Fri, 27 Mar 2015 21:01:53 +0000 (17:01 -0400)
committerAustin Clements <austin@google.com>
Mon, 27 Apr 2015 19:26:37 +0000 (19:26 +0000)
commitbb6320535d6bcef1a5d44cb7429877166c4d5298
tree0827c278158213a567ed818ed52ad8082f1e68be
parent57afa76471ccb3fd9e92349825f90b6c354fc9b5
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>
src/runtime/malloc.go
src/runtime/mgc.go
src/runtime/mgcmark.go
src/runtime/proc1.go
src/runtime/runtime2.go