08d6c4c2b9
Currently the GC CPU limiter doesn't account for idle application time at all. This means that the GC could start thrashing, for example if the live heap exceeds the max heap set by the memory limit, but the limiter will fail to kick in when there's a lot of available idle time. User goroutines will still be assisting at a really high rate because of assist pacing rules, but the GC CPU limiter will fail to kick in because the actual fraction of GC CPU time will be low if there's a lot of otherwise idle time (for example, on an overprovisioned system). Luckily, that idle time is usually eaten up entirely by idle mark workers, at least during the GC cycle. And in these cases where we're GCing continuously, that's all of our idle time. So we can take idle mark work time and subtract it from the mutator time accumulated in the GC CPU limiter, and that will give us a more accurate picture of how much CPU is being spent by user goroutines on GC. This will allow the GC CPU limiter to kick in, and reduce the impact of the thrashing. There is a corner case here if the idle mark workers are disabled, for example for the periodic GC, but in the case of the periodic GC, I don't think it's possible for us to be thrashing at all, so it doesn't really matter. Fixes #52890. Change-Id: Ie133a7d1f89b603434b415d51eb8733c2708a858 Reviewed-on: https://go-review.googlesource.com/c/go/+/405898 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.