]> Cypherpunks repositories - gostls13.git/commit
runtime: lift systemstack part of gcAssistAlloc
authorAustin Clements <austin@google.com>
Sun, 30 Oct 2016 21:46:49 +0000 (17:46 -0400)
committerAustin Clements <austin@google.com>
Mon, 31 Oct 2016 21:58:08 +0000 (21:58 +0000)
commitf9e1adb713e35233ff65f3bde7715377964fafbd
tree8e3696c6e368a82497e712657c7e6552324b8a4c
parentcba0957a91b7f3ce16c06046b5c971e46ff806ef
runtime: lift systemstack part of gcAssistAlloc

This lifts the part of gcAssistAlloc that runs on the system stack to
its own function in preparation for letting assists perform root jobs
(notably stack scanning). This makes it easy to see that there are no
references to the user stack once we've entered gcAssistAlloc1, which
means it's safe to shrink the stack while in gcAssistAlloc1.

This does not yet make assists perform root jobs, so it's not actually
possible for the stack to shrink yet. That will happen in the next
commit.

The code in gcAssistAlloc1 is identical to the code that's currently
passed in a closure to systemstack with one exception. Currently, we
set the "completed" variable in the enclosing scope to indicate that
the assist completed the mark phase. This is exactly the sort of
cross-stack reference lifting this function is meant to prevent. We
replace this variable with setting gp.param to nil or non-nil to
indicate the completion status.

Updates #15361.

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