Commit 38425962 authored by Austin Clements's avatar Austin Clements

runtime: move concurrent mark setup off system stack

For historical reasons we currently do a lot of the concurrent mark
setup on the system stack. In fact, at this point the one and only
thing that needs to happen on the system stack is the start-the-world.

Clean up this code by lifting everything other than the
start-the-world off the system stack.

The diff for this change looks large, but the only code change is to
narrow the systemstack call. Everything else is re-indentation.

Change-Id: I1e03b8afc759fad726f2397b05a17d183c2713ce
Reviewed-on: https://go-review.googlesource.com/16354Reviewed-by: default avatarRick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 19596215
......@@ -1040,7 +1040,6 @@ func gc(mode gcMode) {
gcController.startCycle()
work.heapGoal = gcController.heapGoal
systemstack(func() {
// Enter concurrent mark phase and enable
// write barriers.
//
......@@ -1083,11 +1082,10 @@ func gc(mode gcMode) {
atomicstore(&gcBlackenEnabled, 1)
// Concurrent mark.
startTheWorldWithSema()
systemstack(startTheWorldWithSema)
now = nanotime()
work.pauseNS += now - work.pauseStart
gcController.assistStartTime = now
})
work.tMark = now
// Enable background mark workers and wait for
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment