]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: use a controller to control the scavenge rate
authorMichael Anthony Knyszek <mknyszek@google.com>
Mon, 4 Oct 2021 21:44:06 +0000 (21:44 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 5 Nov 2021 17:46:59 +0000 (17:46 +0000)
commite48e4b4cbbe270bc43e4209dce10c9225254aa64
treef55f95f1d3d3fcd9c268b1a0e27dbc9a261be38a
parentf063e0da28d441065d36f7d676f86d478f67db1f
runtime: use a controller to control the scavenge rate

Currently the scavenge rate is determined by a bunch of ad-hoc
mechanisms. Just use a controller instead, now that we have one.

To facilitate this, the scavenger now attempts to scavenge for at least
1 ms at a time, because any less and the timer system is too imprecise to
give useful feedback to the controller. Also increase the amount that we
scavenge at once, to try to reduce the overheads involved (at the
expense of a little bit of latency).

This change also modifies the controller to accept an update period,
because it's useful to allow that to be variable.

Change-Id: I8a15b2355d0a7c6cbac68c957082d5819618f7d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/353975
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mgcpacer.go
src/runtime/mgcscavenge.go