From: Austin Clements Date: Tue, 24 May 2016 02:05:51 +0000 (-0400) Subject: runtime: document scanstack X-Git-Tag: go1.7beta1~91 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a1f7db88f8c70a7520ce870a71706032f173739f;p=gostls13.git runtime: document scanstack Also mark it go:systemstack and explain why. Change-Id: I88baf22741c04012ba2588d8e03dd3801d19b5c0 Reviewed-on: https://go-review.googlesource.com/23390 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- diff --git a/src/runtime/mgcmark.go b/src/runtime/mgcmark.go index cbdf2b8375..b0e7477d50 100644 --- a/src/runtime/mgcmark.go +++ b/src/runtime/mgcmark.go @@ -642,7 +642,17 @@ func gcFlushBgCredit(scanWork int64) { unlock(&work.assistQueue.lock) } +// scanstack scans gp's stack, greying all pointers found on the stack. +// +// During mark phase, it also installs stack barriers while traversing +// gp's stack. During mark termination, it stops scanning when it +// reaches an unhit stack barrier. +// +// scanstack is marked go:systemstack because it must not be preempted +// while using a workbuf. +// //go:nowritebarrier +//go:systemstack func scanstack(gp *g) { if gp.gcscanvalid { return