mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: add eager scavenging details to GODEBUG=scavtrace=1
Also, clean up atomics on released-per-cycle while we're here. For #57069. Change-Id: I14026e8281f01dea1e8c8de6aa8944712b7b24d9 Reviewed-on: https://go-review.googlesource.com/c/go/+/495916 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
0bbb54a02d
commit
a3e90dc377
5 changed files with 34 additions and 17 deletions
|
|
@ -1323,10 +1323,12 @@ HaveSpan:
|
|||
track := pp.limiterEvent.start(limiterEventScavengeAssist, start)
|
||||
|
||||
// Scavenge, but back out if the limiter turns on.
|
||||
h.pages.scavenge(bytesToScavenge, func() bool {
|
||||
released := h.pages.scavenge(bytesToScavenge, func() bool {
|
||||
return gcCPULimiter.limiting()
|
||||
}, forceScavenge)
|
||||
|
||||
mheap_.pages.scav.releasedEager.Add(released)
|
||||
|
||||
// Finish up accounting.
|
||||
now = nanotime()
|
||||
if track {
|
||||
|
|
@ -1658,7 +1660,7 @@ func (h *mheap) scavengeAll() {
|
|||
gp.m.mallocing--
|
||||
|
||||
if debug.scavtrace > 0 {
|
||||
printScavTrace(released, true)
|
||||
printScavTrace(0, released, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue