runtime: implement STW GC in terms of concurrent GC
runtime: implement STW GC in terms of concurrent GC

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 <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Rick Hudson <838bd060584c511f21c75c69ea04b7b120d86af0@golang.org>

golang/go,CAFxX/go,nawawi/go,CAFxX/go,akutz/go,josharian/go,nawawi/go,josharian/go,nawawi/go,nawawi/go,nawawi/go,CAFxX/go,akutz/go,golang/go,akutz/go,josharian/go,CAFxX/go,CAFxX/go,josharian/go,josharian/go,CAFxX/go,cloudflare/go,akutz/go,CAFxX/go,cloudflare/go,cloudflare/go,golang/go,akutz/go,cloudflare/go,josharian/go,CAFxX/go,golang/go,akutz/go,nawawi/go,nawawi/go,golang/go,cloudflare/go,josharian/go,akutz/go,josharian/go,cloudflare/go,nawawi/go,akutz/go,golang/go,cloudflare/go,golang/go,cloudflare/go,golang/go