]> Cypherpunks repositories - gostls13.git/commit
runtime: make CPU limiter assist time much less error-prone
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 6 May 2022 20:17:52 +0000 (20:17 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 13 May 2022 16:02:20 +0000 (16:02 +0000)
commit2eb8b6eec65d3d214c07067db474bbb93de3443a
tree26d37b4e95d4301475ecb8046f6ea74ec9240d22
parent5a4ba6d90543fc1af8822e4f4d379135cef25655
runtime: make CPU limiter assist time much less error-prone

At the expense of performance (having to update another atomic counter)
this change makes CPU limiter assist time much less error-prone to
manage. There are currently a number of issues with respect to how
scavenge assist time is treated, and this change resolves those by just
having the limiter maintain its own internal pool that's drained on each
update.

While we're here, clear the measured assist time each cycle, which was
the impetus for the change.

Change-Id: I84c513a9f012b4007362a33cddb742c5779782b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/404304
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
src/runtime/export_test.go
src/runtime/mgc.go
src/runtime/mgclimit.go
src/runtime/mgclimit_test.go
src/runtime/mgcmark.go
src/runtime/mgcpacer.go
src/runtime/mheap.go