]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "runtime: scavenge memory upon allocating from scavenged memory"
authorMichael Knyszek <mknyszek@google.com>
Fri, 26 Apr 2019 15:53:44 +0000 (15:53 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 29 Apr 2019 23:06:42 +0000 (23:06 +0000)
This reverts commit 8e093e7a1cd8a092f23717cb8f34bca489a3eee5
(CL 159500).

Reason for revert: Increases memory allocation latency in certain
situations.

Fixes #31679.

Change-Id: I15e02c53a58009fd907b619b8649de2cdeb29ef0
Reviewed-on: https://go-review.googlesource.com/c/go/+/174102
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/mheap.go

index 47e3a333911411b8c3d060bd6a89a6a833e3d1db..6c0ea1bded584a70aa8c49c90d921d1fa2b532c1 100644 (file)
@@ -1198,16 +1198,6 @@ HaveSpan:
                // heap_released since we already did so earlier.
                sysUsed(unsafe.Pointer(s.base()), s.npages<<_PageShift)
                s.scavenged = false
-
-               // Since we allocated out of a scavenged span, we just
-               // grew the RSS. Mitigate this by scavenging enough free
-               // space to make up for it.
-               //
-               // Also, scavengeLargest may cause coalescing, so prevent
-               // coalescing with s by temporarily changing its state.
-               s.state = mSpanManual
-               h.scavengeLargest(s.npages * pageSize)
-               s.state = mSpanFree
        }
        s.unusedsince = 0