• Austin Clements's avatar
    runtime: implement STW GC in terms of concurrent GC · 1678b2c5
    Austin Clements authored
    Currently, STW GC works very differently from concurrent GC. The
    largest differences in that in concurrent GC, all marking work is done
    by background mark workers during the mark phase, while in STW GC, all
    marking work is done by gchelper during the mark termination phase.
    
    This is a consequence of the evolution of Go's GC from a STW GC by
    incrementally moving work from STW mark termination into concurrent
    mark. However, at this point, the STW code paths exist only as a
    debugging mode. Having separate code paths for this increases the
    maintenance burden and complexity of the garbage collector. At the
    same time, these code paths aren't tested nearly as well, making it
    far more likely that they will bit-rot.
    
    This CL reverses the relationship between STW GC, by re-implementing
    STW GC in terms of concurrent GC.
    
    This builds on the new scheduled support for disabling user goroutine
    scheduling. During sweep termination, it disables user scheduling, so
    when the GC starts the world again for concurrent mark, it's really
    only "concurrent" with itself.
    
    There are several code paths that were specific to STW GC that are now
    vestigial. We'll remove these in the follow-up CLs.
    
    Updates #26903.
    
    Change-Id: Ia3883d2fcf7ab1d89bdc9c8ee54bf9bffb32c096
    Reviewed-on: https://go-review.googlesource.com/c/134780
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    1678b2c5
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...