diff options
author | Ian Lance Taylor <iant@golang.org> | 2022-02-06 19:33:03 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2022-02-07 18:19:38 +0000 |
commit | 8f374aa27f887d78ef709115c140fd5862691df0 (patch) | |
tree | 9269ba085816a88f3c44f24f65783c5b7a53e535 /src/runtime/mgcpacer.go | |
parent | fa0484640479a26687608706c9f6628eac1174d2 (diff) | |
download | go-8f374aa27f887d78ef709115c140fd5862691df0.tar.gz go-8f374aa27f887d78ef709115c140fd5862691df0.zip |
runtime: don't assume that 0.25 * 100 is representable as int
For the gofrontend, it's not; there are some trailing one bits,
which is permitted by the spec.
Change-Id: I58f5a5347068bb488306ec8e73da7c59376f1ae1
Reviewed-on: https://go-review.googlesource.com/c/go/+/383635
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/mgcpacer.go')
-rw-r--r-- | src/runtime/mgcpacer.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/mgcpacer.go b/src/runtime/mgcpacer.go index 6df8af45a8..f06560201a 100644 --- a/src/runtime/mgcpacer.go +++ b/src/runtime/mgcpacer.go @@ -677,7 +677,8 @@ func (c *gcControllerState) endCycle(now int64, procs int, userForced bool) floa if debug.gcpacertrace > 0 { printlock() - print("pacer: ", int(utilization*100), "% CPU (", int(gcGoalUtilization*100), " exp.) for ") + goal := gcGoalUtilization * 100 + print("pacer: ", int(utilization*100), "% CPU (", int(goal), " exp.) for ") print(c.heapScanWork.Load(), "+", c.stackScanWork.Load(), "+", c.globalsScanWork.Load(), " B work (", c.lastHeapScan+c.stackScan+c.globalsScan, " B exp.) ") print("in ", c.trigger, " B -> ", c.heapLive, " B (∆goal ", int64(c.heapLive)-int64(c.heapGoal), ", cons/mark ", oldConsMark, ")") println() |