]> Cypherpunks repositories - gostls13.git/commit
runtime: use hard heap goal if we've done more scan work than expected
authorMichael Knyszek <mknyszek@google.com>
Thu, 27 Jun 2019 18:46:29 +0000 (14:46 -0400)
committerMichael Knyszek <mknyszek@google.com>
Wed, 4 Sep 2019 21:52:18 +0000 (21:52 +0000)
commitaae0b5b0b26bf4fd26cad0111535d703691a9083
tree79eae2f04f45f55f9e28807788bde6e567c24147
parentd21953df047868ed3bcfd0172a6c1672642f5b4a
runtime: use hard heap goal if we've done more scan work than expected

This change makes it so that if we're already finding ourselves in a
situation where we've done more scan work than expected in the
steady-state (that is, 50% of heap_scan for GOGC=100), then we fall back
on the hard heap goal instead of continuing to assume the expected case.

In some cases its possible that we're already doing more scan work than
expected, and if GC assists come in just at that window where we notice
it, they might accumulate way too much assist credit, causing undue heap
growths if GOMAXPROCS=1 (since the fractional background worker isn't
guaranteed to fire). This case seems awfully specific, and that's
because it's exactly the case for TestGcSys, which has been flaky for
some time as a result.

Fixes #28574, #27636, and #27156.

Change-Id: I771f42bed34739dbb1b84ad82cfe247f70836031
Reviewed-on: https://go-review.googlesource.com/c/go/+/184097
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/gc_test.go
src/runtime/mgc.go