aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2023-05-18 17:19:37 +0000
committerMichael Knyszek <mknyszek@google.com>2023-05-19 16:24:53 +0000
commit24617a068c55d0ee7ef56d1b9fb951ee1e75f67d (patch)
tree0c654f44e7b5b69d8a98769455180ced6ffd6a11 /src/runtime
parent78df00dd6f47eb13ff2873fb92223d8b64323d32 (diff)
downloadgo-24617a068c55d0ee7ef56d1b9fb951ee1e75f67d.tar.xz
runtime: flush idle time to sched.idleTime on limiter event consumption
This was an oversight, which might cause accounted-for idle time to be lost. Noticed this while working on #60276. Change-Id: Ic743785d6dc82555e660f2c9b6aaa9dedef56ed8 Reviewed-on: https://go-review.googlesource.com/c/go/+/496117 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/mgclimit.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/mgclimit.go b/src/runtime/mgclimit.go
index 51c5506eee..ef3cc081ce 100644
--- a/src/runtime/mgclimit.go
+++ b/src/runtime/mgclimit.go
@@ -212,6 +212,7 @@ func (l *gcCPULimiterState) updateLocked(now int64) {
fallthrough
case limiterEventIdle:
idleTime += duration
+ sched.idleTime.Add(duration)
case limiterEventMarkAssist:
fallthrough
case limiterEventScavengeAssist: