]> Cypherpunks repositories - gostls13.git/commit
runtime: remove stack barriers during concurrent mark
authorAustin Clements <austin@google.com>
Wed, 2 Mar 2016 19:52:08 +0000 (14:52 -0500)
committerAustin Clements <austin@google.com>
Tue, 26 Apr 2016 23:40:01 +0000 (23:40 +0000)
commit269c969c81774d1579e80a8c35edbd0ebea065a7
tree1d1ff97a4feb2ed348266ebe748d4f04b28f0306
parentefb0c55407cdbef6aa5471f057b8afd1d0303369
runtime: remove stack barriers during concurrent mark

Currently we remove stack barriers during STW mark termination, which
has a non-trivial per-goroutine cost and means that we have to touch
even clean stacks during mark termination. However, there's no problem
with leaving them in during the sweep phase. They just have to be out
by the time we install new stack barriers immediately prior to
scanning the stack such as during the mark phase of the next GC cycle
or during mark termination in a STW GC.

Hence, move the gcRemoveStackBarriers from STW mark termination to
just before we install new stack barriers during concurrent mark. This
removes the cost from STW. Furthermore, this combined with concurrent
stack shrinking means that the mark termination scan of a clean stack
is a complete no-op, which will make it possible to skip clean stacks
entirely during mark termination.

This has the downside that it will mess up anything outside of Go that
tries to walk Go stacks all the time instead of just some of the time.
This includes tools like GDB, perf, and VTune. We'll improve the
situation shortly.

Change-Id: Ia40baad8f8c16aeefac05425e00b0cf478137097
Reviewed-on: https://go-review.googlesource.com/20667
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/mgcmark.go
src/runtime/mstkbar.go