aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mgcmark.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2018-08-16 11:47:36 -0400
committerAustin Clements <austin@google.com>2018-10-02 20:35:27 +0000
commit198440cc3d3453d349fbc7894a5d91dd7b16e6a0 (patch)
tree130f5c78b2cd3fa41cc69a7865ae593c28c60495 /src/runtime/mgcmark.go
parentecc365960ba7ff72f650b32190f40a1f1b6ff992 (diff)
downloadgo-198440cc3d3453d349fbc7894a5d91dd7b16e6a0.tar.gz
go-198440cc3d3453d349fbc7894a5d91dd7b16e6a0.zip
runtime: remove GODEBUG=gcrescanstacks=1 mode
Currently, setting GODEBUG=gcrescanstacks=1 enables a debugging mode where the garbage collector re-scans goroutine stacks during mark termination. This was introduced in Go 1.8 to debug the hybrid write barrier, but I don't think we ever used it. Now it's one of the last sources of mark work during mark termination. This CL removes it. Updates #26903. This is preparation for unifying STW GC and concurrent GC. Updates #17503. Change-Id: I6ae04d3738aa9c448e6e206e21857a33ecd12acf Reviewed-on: https://go-review.googlesource.com/c/134777 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/mgcmark.go')
-rw-r--r--src/runtime/mgcmark.go22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/runtime/mgcmark.go b/src/runtime/mgcmark.go
index b86b2d012e..07b8f791d4 100644
--- a/src/runtime/mgcmark.go
+++ b/src/runtime/mgcmark.go
@@ -116,11 +116,6 @@ func gcMarkRootPrepare() {
// contain pointers to unmarked objects, so on the
// second markroot, there's no need to scan stacks.
work.nStackRoots = 0
-
- if debug.gcrescanstacks > 0 {
- // Scan stacks anyway for debugging.
- work.nStackRoots = int(atomic.Loaduintptr(&allglen))
- }
}
work.markrootNext = 0
@@ -138,19 +133,10 @@ func gcMarkRootCheck() {
lock(&allglock)
// Check that stacks have been scanned.
var gp *g
- if gcphase == _GCmarktermination && debug.gcrescanstacks > 0 {
- for i := 0; i < len(allgs); i++ {
- gp = allgs[i]
- if !(gp.gcscandone && gp.gcscanvalid) && readgstatus(gp) != _Gdead {
- goto fail
- }
- }
- } else {
- for i := 0; i < work.nStackRoots; i++ {
- gp = allgs[i]
- if !gp.gcscandone {
- goto fail
- }
+ for i := 0; i < work.nStackRoots; i++ {
+ gp = allgs[i]
+ if !gp.gcscandone {
+ goto fail
}
}
unlock(&allglock)