]> Cypherpunks repositories - gostls13.git/commit
runtime: track total idle time for GC CPU limiter
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 2 Jun 2022 21:26:49 +0000 (21:26 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 3 Jun 2022 20:16:45 +0000 (20:16 +0000)
commit54bd44e5738e3a6499b8b9f9fedc7b399d333cc0
tree4ff7ff1eda1377c4d80f6f85c9bd5cb838b01de9
parent73587b71a62f7c7a27664a207781dedae223774b
runtime: track total idle time for GC CPU limiter

Currently the GC CPU limiter only tracks idle GC work time. However, in
very undersubscribed situations, it's possible that all this extra idle
time prevents the enabling of the limiter, since it all gets account for
as mutator time. Fix this by tracking all idle time via pidleget and
pidleput. To support this, pidleget and pidleput also accept and return
"now" parameters like the timer code.

While we're here, let's clean up some incorrect assumptions that some of
the scheduling code makes about "now."

Fixes #52890.

Change-Id: I4a97893d2e5ad1e8c821f8773c2a1d449267c951
Reviewed-on: https://go-review.googlesource.com/c/go/+/410122
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/runtime/mgclimit.go
src/runtime/mgcpacer.go
src/runtime/proc.go