mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: pass work.userForced to gcController.endCycle explicitly
For #44167. Change-Id: I15817006f1870d6237cd06dabad988da3f23a6d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/306604 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
3eaf75c13a
commit
e9cc31e736
2 changed files with 5 additions and 3 deletions
|
|
@ -898,7 +898,7 @@ top:
|
|||
// endCycle depends on all gcWork cache stats being flushed.
|
||||
// The termination algorithm above ensured that up to
|
||||
// allocations since the ragged barrier.
|
||||
nextTriggerRatio := gcController.endCycle()
|
||||
nextTriggerRatio := gcController.endCycle(work.userForced)
|
||||
|
||||
// Perform mark termination. This will restart the world.
|
||||
gcMarkTermination(nextTriggerRatio)
|
||||
|
|
|
|||
|
|
@ -444,8 +444,10 @@ func (c *gcControllerState) revise() {
|
|||
}
|
||||
|
||||
// endCycle computes the trigger ratio for the next cycle.
|
||||
func (c *gcControllerState) endCycle() float64 {
|
||||
if work.userForced {
|
||||
// userForced indicates whether the current GC cycle was forced
|
||||
// by the application.
|
||||
func (c *gcControllerState) endCycle(userForced bool) float64 {
|
||||
if userForced {
|
||||
// Forced GC means this cycle didn't start at the
|
||||
// trigger, so where it finished isn't good
|
||||
// information about how to adjust the trigger.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue