Skip to content

Commit

Permalink
runtime: don't disable GC work caching during mark termination
Browse files Browse the repository at this point in the history
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 <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Rick Hudson <[email protected]>
  • Loading branch information
aclements committed Oct 2, 2018
1 parent d398dbd commit e25ef35
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/runtime/mgc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/runtime/mgcmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}

Expand Down
5 changes: 0 additions & 5 deletions src/runtime/mwbbuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

0 comments on commit e25ef35

Please sign in to comment.