aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mpagealloc.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2023-05-17 16:36:07 +0000
committerMichael Knyszek <mknyszek@google.com>2023-05-19 13:38:43 +0000
commita3e90dc3775307e5f0de0e2c0726841c17363616 (patch)
treee955bc7b1b5a0cf565c2f87e5a77586644e68118 /src/runtime/mpagealloc.go
parent0bbb54a02d38d067b9a39d85cfc425f0ddc2962e (diff)
downloadgo-a3e90dc3775307e5f0de0e2c0726841c17363616.tar.xz
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>
Diffstat (limited to 'src/runtime/mpagealloc.go')
-rw-r--r--src/runtime/mpagealloc.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/runtime/mpagealloc.go b/src/runtime/mpagealloc.go
index 12ae474a4d..ed53a5672b 100644
--- a/src/runtime/mpagealloc.go
+++ b/src/runtime/mpagealloc.go
@@ -48,6 +48,7 @@
package runtime
import (
+ "runtime/internal/atomic"
"unsafe"
)
@@ -270,10 +271,13 @@ type pageAlloc struct {
// scavenge.
index scavengeIndex
- // released is the amount of memory released this scavenge cycle.
- //
- // Updated atomically.
- released uintptr
+ // releasedBg is the amount of memory released in the background this
+ // scavenge cycle.
+ releasedBg atomic.Uintptr
+
+ // releasedEager is the amount of memory released eagerly this scavenge
+ // cycle.
+ releasedEager atomic.Uintptr
}
// mheap_.lock. This level of indirection makes it possible