]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: remove go119MemoryLimitSupport flag
authorKeith Randall <khr@golang.org>
Thu, 26 Jan 2023 22:46:51 +0000 (14:46 -0800)
committerKeith Randall <khr@golang.org>
Sat, 28 Jan 2023 20:46:29 +0000 (20:46 +0000)
Change-Id: I207480d991c6242a1610795605c5ec6a3b3c59de
Reviewed-on: https://go-review.googlesource.com/c/go/+/463225
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/runtime/mgcmark.go
src/runtime/mgcpacer.go
src/runtime/mgcscavenge.go
src/runtime/mheap.go
src/runtime/runtime1.go

index cfda7064cdf4bb6d99033f9082fe7080f34e2ed2..fa8c81d8efc1101355ea45137fc3f0352b8b40a5 100644 (file)
@@ -414,7 +414,7 @@ func gcAssistAlloc(gp *g) {
 
        traced := false
 retry:
-       if go119MemoryLimitSupport && gcCPULimiter.limiting() {
+       if gcCPULimiter.limiting() {
                // If the CPU limiter is enabled, intentionally don't
                // assist to reduce the amount of CPU time spent in the GC.
                if traced {
index 9d9840e80bdeae381ba8e9e5de6e6bdb753310ed..41b07d02a514417688c9a8b490187062ec76bd05 100644 (file)
@@ -11,12 +11,6 @@ import (
        _ "unsafe" // for go:linkname
 )
 
-// go119MemoryLimitSupport is a feature flag for a number of changes
-// related to the memory limit feature (#48409). Disabling this flag
-// disables those features, as well as the memory limit mechanism,
-// which becomes a no-op.
-const go119MemoryLimitSupport = true
-
 const (
        // gcGoalUtilization is the goal CPU utilization for
        // marking as a fraction of GOMAXPROCS.
@@ -899,7 +893,7 @@ func (c *gcControllerState) heapGoalInternal() (goal, minTrigger uint64) {
        goal = c.gcPercentHeapGoal.Load()
 
        // Check if the memory-limit-based goal is smaller, and if so, pick that.
-       if newGoal := c.memoryLimitHeapGoal(); go119MemoryLimitSupport && newGoal < goal {
+       if newGoal := c.memoryLimitHeapGoal(); newGoal < goal {
                goal = newGoal
        } else {
                // We're not limited by the memory limit goal, so perform a series of
index e59340ec7c5329706b078a8c13cdd283ce55947d..e0c04ffbc437931e13751bf94c108250d509b0c5 100644 (file)
@@ -379,8 +379,7 @@ func (s *scavengerState) init() {
                s.shouldStop = func() bool {
                        // If background scavenging is disabled or if there's no work to do just stop.
                        return heapRetained() <= scavenge.gcPercentGoal.Load() &&
-                               (!go119MemoryLimitSupport ||
-                                       gcController.mappedReady.Load() <= scavenge.memoryLimitGoal.Load())
+                               gcController.mappedReady.Load() <= scavenge.memoryLimitGoal.Load()
                }
        }
        if s.gomaxprocs == nil {
index 1401e92f4e043f433d5a3a88fd670757baf884cd..6fff43214cbe33229f7c496423cabec48539b7f7 100644 (file)
@@ -1270,7 +1270,7 @@ HaveSpan:
        // pages not to get touched until we return. Simultaneously, it's important
        // to do this before calling sysUsed because that may commit address space.
        bytesToScavenge := uintptr(0)
-       if limit := gcController.memoryLimit.Load(); go119MemoryLimitSupport && !gcCPULimiter.limiting() {
+       if limit := gcController.memoryLimit.Load(); !gcCPULimiter.limiting() {
                // Assist with scavenging to maintain the memory limit by the amount
                // that we expect to page in.
                inuse := gcController.mappedReady.Load()
index 5f9555e40490e60fb46512c28e468d8ce846975a..f5d74b7aedef504919cec8c6c83d4eced97847e1 100644 (file)
@@ -364,7 +364,7 @@ func parsedebugvars() {
        // defaults
        debug.cgocheck = 1
        debug.invalidptr = 1
-       debug.adaptivestackstart = 1 // go119 - set this to 0 to turn larger initial goroutine stacks off
+       debug.adaptivestackstart = 1 // set this to 0 to turn larger initial goroutine stacks off
        if GOOS == "linux" {
                // On Linux, MADV_FREE is faster than MADV_DONTNEED,
                // but doesn't affect many of the statistics that