]> Cypherpunks repositories - gostls13.git/commit
runtime: sysUsed spans after trimming
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 5 Oct 2018 18:11:02 +0000 (18:11 +0000)
committerMichael Knyszek <mknyszek@google.com>
Tue, 30 Oct 2018 15:28:24 +0000 (15:28 +0000)
commitdb82a1bc12c54f1b6d32a3d41c4422605b16b7e8
tree5f607607b1637c6270c4b91809a2fc37acff4e51
parent61d40c8abc82fd845b5e4340bdf0495de0de7ecd
runtime: sysUsed spans after trimming

Currently, we mark a whole span as sysUsed before trimming, but this
unnecessarily tells the OS that the trimmed section from the span is
used when it may have been scavenged, if s was scavenged. Overall,
this just makes invocations of sysUsed a little more fine-grained.

It does come with the caveat that now heap_released needs to be managed
a little more carefully in allocSpanLocked. In this case, we choose to
(like before this change) negate any effect the span has on
heap_released before trimming, then add it back if the trimmed part is
scavengable.

For #14045.

Change-Id: Ifa384d989611398bfad3ca39d3bb595a5962a3ea
Reviewed-on: https://go-review.googlesource.com/c/140198
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/mheap.go