• Michael Knyszek's avatar
    runtime: use hard heap goal if we've done more scan work than expected · aae0b5b0
    Michael Knyszek authored
    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: default avatarKeith Randall <khr@golang.org>
    aae0b5b0
gc_test.go 13.8 KB