]> Cypherpunks repositories - gostls13.git/commit
runtime: scavenge huge spans first
authorMichael Anthony Knyszek <mknyszek@google.com>
Mon, 29 Apr 2019 20:58:39 +0000 (20:58 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 6 May 2019 20:57:39 +0000 (20:57 +0000)
commita62b5723be15849656279c244834064b951801fc
tree846fc5bf35b97b1e506d78e3aeccbefdfe593925
parentfa8470a8cd42a0ceff315232ec7e8a30ed1ff7d3
runtime: scavenge huge spans first

This change adds two new treap iteration types: one for large
unscavenged spans (contain at least one huge page) and one for small
unscavenged spans. This allows us to scavenge the huge spans first by
first iterating over the large ones, then the small ones.

Also, since we now depend on physHugePageSize being a power of two,
ensure that that's the case when it's retrieved from the OS.

For #30333.

Change-Id: I51662740205ad5e4905404a0856f5f2b2d2a5680
Reviewed-on: https://go-review.googlesource.com/c/go/+/174399
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/export_test.go
src/runtime/mgclarge.go
src/runtime/mheap.go
src/runtime/os_linux.go
src/runtime/treap_test.go