]> Cypherpunks repositories - gostls13.git/commit
runtime: consolidate all trigger-derived computations
authorAustin Clements <austin@google.com>
Mon, 3 Apr 2017 16:10:56 +0000 (12:10 -0400)
committerAustin Clements <austin@google.com>
Fri, 21 Apr 2017 17:41:55 +0000 (17:41 +0000)
commitee175afac237c9fcb54785eec2890dfb0dd6825f
tree218badaa70236279e7ffc9500ef84396bcb4acd4
parent49a412a5b7f2b7ca6278da199b812bac3c683046
runtime: consolidate all trigger-derived computations

Currently, the computations that derive controls from the GC trigger
are spread across several parts of the mark termination code.
Consolidate computing the absolute trigger, the heap goal, and sweep
pacing into a single function called at the end of mark termination.

Unlike the code being consolidated, this has to be more careful about
negative gcpercent. Many of the consolidated code paths simply didn't
execute if GC was off.

This is a step toward being able to change the GC trigger ratio in the
middle of concurrent sweeping and marking. For this commit, we try to
stick close to the original structure of the code that's being
consolidated, so it doesn't yet support mid-cycle adjustments.

For #19076.

Change-Id: Ic5335be04b96ad20e70d53d67913a86bd6b31456
Reviewed-on: https://go-review.googlesource.com/39831
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgc.go