mirror of
https://github.com/golang/go.git
synced 2025-10-29 15:54:14 +00:00
runtime: decentralize mark done and mark termination
This moves all of the mark 1 to mark 2 transition and mark termination to the mark done transition function. This means these transitions are now handled on the goroutine that detected mark completion. This also means that the GC coordinator and the background completion barriers are no longer used and various workarounds to yield to the coordinator are no longer necessary. These will be removed in follow-up commits. One consequence of this is that mark workers now need to be preemptible when performing the mark done transition. This allows them to stop the world and to perform the final clean-up steps of GC after restarting the world. They are only made preemptible while performing this transition, so if the worker findRunnableGCWorker would schedule isn't available, we didn't want to schedule it anyway. Fixes #11970. Change-Id: I9203a2d6287eeff62d589ec02ad9cb1e29ddb837 Reviewed-on: https://go-review.googlesource.com/16391 Reviewed-by: Rick Hudson <rlh@golang.org> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
d986bf2741
commit
c99d7f7f85
4 changed files with 121 additions and 77 deletions
|
|
@ -742,8 +742,7 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
|
|||
// down this G's allocation and help the GC stay
|
||||
// scheduled by yielding.
|
||||
//
|
||||
// TODO: This is a workaround. Either help the GC make
|
||||
// the transition or block.
|
||||
// TODO: This is unused. Remove.
|
||||
gp := getg()
|
||||
if gp != gp.m.g0 && gp.m.locks == 0 && gp.m.preemptoff == "" {
|
||||
Gosched()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue