]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: flush idle time to sched.idleTime on limiter event consumption
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 18 May 2023 17:19:37 +0000 (17:19 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 19 May 2023 16:24:53 +0000 (16:24 +0000)
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>
src/runtime/mgclimit.go

index 51c5506eee4b9d98cd82229528cf613248a5c833..ef3cc081cec3d2fce215ac7f104994c56573f98e 100644 (file)
@@ -212,6 +212,7 @@ func (l *gcCPULimiterState) updateLocked(now int64) {
                                fallthrough
                        case limiterEventIdle:
                                idleTime += duration
+                               sched.idleTime.Add(duration)
                        case limiterEventMarkAssist:
                                fallthrough
                        case limiterEventScavengeAssist: