diff options
| author | Austin Clements <austin@google.com> | 2017-04-03 15:47:11 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2017-04-21 17:41:59 +0000 |
| commit | 1c4f3c5ea0267e8ebc990ee67c09efa01cb59746 (patch) | |
| tree | d515f87144d043e91ec7c77c1f59ac4091fcfa07 /src/runtime/debug/garbage_test.go | |
| parent | a5eb3dceaf8d4e3fafac0d947decae62d3028df1 (diff) | |
| download | go-1c4f3c5ea0267e8ebc990ee67c09efa01cb59746.tar.xz | |
runtime: make gcSetTriggerRatio work at any time
This changes gcSetTriggerRatio so it can be called even during
concurrent mark or sweep. In this case, it will adjust the pacing of
the current phase, accounting for progress that has already been made.
To make this work for concurrent sweep, this introduces a "basis" for
the pagesSwept count, much like the basis we just introduced for
heap_live. This lets gcSetTriggerRatio shift the basis to the current
heap_live and pagesSwept and compute a slope from there to completion.
This avoids creating a discontinuity where, if the ratio has
increased, there has to be a flurry of sweep activity to catch up.
Instead, this creates a continuous, piece-wise linear function as
adjustments are made.
For #19076.
Change-Id: Ibcd76aeeb81ff4814b00be7cbd3530b73bbdbba9
Reviewed-on: https://go-review.googlesource.com/39833
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/debug/garbage_test.go')
0 files changed, 0 insertions, 0 deletions
