diff options
| author | Austin Clements <austin@google.com> | 2015-03-16 14:22:00 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2015-04-21 15:35:18 +0000 |
| commit | 4b2fde945a79657cf77b8a173c0143208e7b88b1 (patch) | |
| tree | c366e87ff8a6416cf539921f8a8a981bb318fd8c /src/runtime/runtime2.go | |
| parent | 028f9728473c6e7590ecaa7d30b0288df4a5731a (diff) | |
| download | go-4b2fde945a79657cf77b8a173c0143208e7b88b1.tar.xz | |
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>
Diffstat (limited to 'src/runtime/runtime2.go')
| -rw-r--r-- | src/runtime/runtime2.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index a59d77df85..18722bc6d3 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -241,6 +241,10 @@ type g struct { racectx uintptr waiting *sudog // sudog structures this g is waiting on (that have a valid elem ptr) readyg *g // scratch for readyExecute + + // Per-G gcController state + gcalloc uintptr // bytes allocated during this GC cycle + gcscanwork int64 // scan work done (or stolen) this GC cycle } type mts struct { |
