aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/extern.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2019-11-21 17:05:14 +0000
committerMichael Knyszek <mknyszek@google.com>2020-05-08 16:24:40 +0000
commit55ec5182d7b84eb2461c495a55984162b23f3df8 (patch)
tree87d24203820c776f090d73e93fd931cbfdcffdb4 /src/runtime/extern.go
parentb1a48af7e8ee87cc46e1bbb07f81ac4853e0f27b (diff)
downloadgo-55ec5182d7b84eb2461c495a55984162b23f3df8.tar.gz
go-55ec5182d7b84eb2461c495a55984162b23f3df8.zip
runtime: remove scavAddr in favor of address ranges
This change removes the concept of s.scavAddr in favor of explicitly reserving and unreserving address ranges. s.scavAddr has several problems with raciness that can cause the scavenger to miss updates, or move it back unnecessarily, forcing future scavenge calls to iterate over searched address space unnecessarily. This change achieves this by replacing scavAddr with a second addrRanges which is cloned from s.inUse at the end of each sweep phase. Ranges from this second addrRanges are then reserved by scavengers (with the reservation size proportional to the heap size) who are then able to safely iterate over those ranges without worry of another scavenger coming in. Fixes #35788. Change-Id: Ief01ae170384174875118742f6c26b2a41cbb66d Reviewed-on: https://go-review.googlesource.com/c/go/+/208378 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/extern.go')
-rw-r--r--src/runtime/extern.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/extern.go b/src/runtime/extern.go
index 0ecc4eaf71..4fa21f0a35 100644
--- a/src/runtime/extern.go
+++ b/src/runtime/extern.go
@@ -104,10 +104,11 @@ It is a comma-separated list of name=val pairs setting these named variables:
scavenger as well as the total amount of memory returned to the operating system
and an estimate of physical memory utilization. The format of this line is subject
to change, but currently it is:
- scav # KiB work, # KiB total, #% util
+ scav # # KiB work, # KiB total, #% util
where the fields are as follows:
- # KiB work the amount of memory returned to the OS since the last scav line
- # KiB total how much of the heap at this point in time has been released to the OS
+ scav # the scavenge cycle number
+ # KiB work the amount of memory returned to the OS since the last line
+ # KiB total the total amount of memory returned to the OS
#% util the fraction of all unscavenged memory which is in-use
If the line ends with "(forced)", then scavenging was forced by a
debug.FreeOSMemory() call.