]> Cypherpunks repositories - gostls13.git/commit
runtime: fix scavenging tests for pallocChunkBytes huge pages and larger
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 20 Oct 2020 12:57:14 +0000 (12:57 +0000)
committerMichael Knyszek <mknyszek@google.com>
Tue, 20 Oct 2020 15:19:09 +0000 (15:19 +0000)
commit05f5ae74bc95b0d77a512029bc1a6739c5d0f181
tree6b1b5774567446ba8855d9610bee2c93c9d44f35
parent0bf507efe9f995076e3a65bcf61baf3e905b58c7
runtime: fix scavenging tests for pallocChunkBytes huge pages and larger

Currently the scavenging tests implicitly assume that the system huge
page size is always strictly less than 4 MiB, or pallocChunkBytes. This
leads to failures on systems with huge pages of this size, and larger.

Filter out those tests on such platforms and add a test for the 4 MiB
case. The scavenger is already equipped to handle this case.

Huge page sizes > 4 MiB are effectively ignored, so also add a test case
to ensure that happens.

Unfortunately we can't actually run these tests in our CI because they
require the platform to provide the right huge page size, but we really
should just parameterize this value so we can test it (there's a TODO
about this already).

Fixes #42053.

Change-Id: Ia576cbf67e178a14a178a893967efbed27d6eb17
Reviewed-on: https://go-review.googlesource.com/c/go/+/263837
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
src/runtime/mgcscavenge_test.go