From 24617a068c55d0ee7ef56d1b9fb951ee1e75f67d Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Thu, 18 May 2023 17:19:37 +0000 Subject: [PATCH] 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 TryBot-Result: Gopher Robot Reviewed-by: Michael Pratt --- src/runtime/mgclimit.go | 1 + 1 file changed, 1 insertion(+) 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: -- 2.50.0