]> Cypherpunks repositories - gostls13.git/commit
runtime: proportional mutator assist
authorAustin Clements <austin@google.com>
Mon, 16 Mar 2015 18:22:00 +0000 (14:22 -0400)
committerAustin Clements <austin@google.com>
Tue, 21 Apr 2015 15:35:18 +0000 (15:35 +0000)
commit4b2fde945a79657cf77b8a173c0143208e7b88b1
treec366e87ff8a6416cf539921f8a8a981bb318fd8c
parent028f9728473c6e7590ecaa7d30b0288df4a5731a
runtime: proportional mutator assist

Currently, mutator allocation periodically assists the garbage
collector by performing a small, fixed amount of scanning work.
However, to control heap growth, mutators need to perform scanning
work *proportional* to their allocation rate.

This change implements proportional mutator assists. This uses the
scan work estimate computed by the garbage collector at the beginning
of each cycle to compute how much scan work must be performed per
allocation byte to complete the estimated scan work by the time the
heap reaches the goal size. When allocation triggers an assist, it
uses this ratio and the amount allocated since the last assist to
compute the assist work, then attempts to steal as much of this work
as possible from the background collector's credit, and then performs
any remaining scan work itself.

Change-Id: I98b2078147a60d01d6228b99afd414ef857e4fba
Reviewed-on: https://go-review.googlesource.com/8836
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/malloc.go
src/runtime/mgc.go
src/runtime/mgcmark.go
src/runtime/runtime2.go