]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: don't disable GC work caching during mark termination
authorAustin Clements <austin@google.com>
Tue, 14 Aug 2018 21:08:27 +0000 (17:08 -0400)
committerAustin Clements <austin@google.com>
Tue, 2 Oct 2018 20:35:23 +0000 (20:35 +0000)
Currently, we disable GC work caching during mark termination. This is
no longer necessary with the new mark completion detection because

1. There's no way for any of the GC mark termination helpers to have
any real work queued and,

2. Mark termination has to explicitly flush every P's buffers anyway
in order to flush Ps that didn't run a GC mark termination helper.

Hence, remove the code that disposes gcWork buffers during mark
termination.

Updates #26903. This is a follow-up to eliminating mark 2.

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

index 69fd8df662bdf8dc6498176c394604432331c23d..83d9a49a464241550392b1b4b7230cf7aa4a0d56 100644 (file)
@@ -1931,7 +1931,6 @@ func gcMark(start_time int64) {
        } else {
                gcDrain(gcw, gcDrainNoBlock)
        }
-       gcw.dispose()
 
        if debug.gccheckmark > 0 {
                // This is expensive when there's a large number of
@@ -2130,7 +2129,6 @@ func gchelper() {
                } else {
                        gcDrain(gcw, gcDrainNoBlock)
                }
-               gcw.dispose()
        }
 
        nproc := atomic.Load(&work.nproc) // work.nproc can change right after we increment work.ndone
index 6c641e3fbf2523b72fd4c5f7f9e7bcb0b820176a..b86b2d012e5f0ed21ab6705ff853fd4599d070e2 100644 (file)
@@ -1149,11 +1149,6 @@ func shade(b uintptr) {
        if obj, span, objIndex := findObject(b, 0, 0); obj != 0 {
                gcw := &getg().m.p.ptr().gcw
                greyobject(obj, 0, 0, span, gcw, objIndex)
-               if gcphase == _GCmarktermination {
-                       // Ps aren't allowed to cache work during mark
-                       // termination.
-                       gcw.dispose()
-               }
        }
 }
 
index 335b10f5b78252b17e132ec06978a2b22680ac11..f35f7286acbad665f7c5ed3c3ecd7e586ad24f4f 100644 (file)
@@ -275,9 +275,4 @@ func wbBufFlush1(_p_ *p) {
 
        // Enqueue the greyed objects.
        gcw.putBatch(ptrs[:pos])
-       if gcphase == _GCmarktermination {
-               // Ps aren't allowed to cache work during mark
-               // termination.
-               gcw.dispose()
-       }
 }