Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263236: runtime/os/TestTracePageSizes.java fails on old kernels #3415

Closed
@@ -25,6 +25,8 @@
* @test id=no-options
* @summary Run test with no arguments apart from the ones required by
* the test.
* @library /test/lib
* @build jdk.test.lib.Platform
* @requires os.family == "linux"
* @run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log TestTracePageSizes
*/
@@ -33,6 +35,8 @@
* @test id=explicit-large-page-size
* @summary Run test explicitly with both 2m and 1g pages on x64. Excluding ZGC since
* it fail initialization if no large pages are available on the system.
* @library /test/lib
* @build jdk.test.lib.Platform
* @requires os.family == "linux"
* @requires os.arch=="amd64" | os.arch=="x86_64"
* @requires vm.gc != "Z"
@@ -44,6 +48,8 @@
* @test id=compiler-options
* @summary Run test without segmented code cache. Excluding ZGC since it
* fail initialization if no large pages are available on the system.
* @library /test/lib
* @build jdk.test.lib.Platform
* @requires os.family == "linux"
* @requires vm.gc != "Z"
* @run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log -XX:-SegmentedCodeCache TestTracePageSizes
@@ -54,6 +60,8 @@
/*
* @test id=with-G1
* @summary Run tests with G1
* @library /test/lib
* @build jdk.test.lib.Platform
* @requires os.family == "linux"
* @requires vm.gc.G1
* @run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log -XX:+UseG1GC TestTracePageSizes
@@ -64,6 +72,8 @@
/*
* @test id=with-Parallel
* @summary Run tests with Parallel
* @library /test/lib
* @build jdk.test.lib.Platform
* @requires os.family == "linux"
* @requires vm.gc.Parallel
* @run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log -XX:+UseParallelGC TestTracePageSizes
@@ -74,6 +84,8 @@
/*
* @test id=with-Serial
* @summary Run tests with Serial
* @library /test/lib
* @build jdk.test.lib.Platform
* @requires os.family == "linux"
* @requires vm.gc.Serial
* @run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log -XX:+UseSerialGC TestTracePageSizes
@@ -87,6 +99,9 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import jdk.test.lib.Platform;
import jtreg.SkippedException;

// Check that page sizes logged match what is recorded in /proc/self/smaps.
// For transparent huge pages the matching is best effort since we can't
// know for sure what the underlying page size is.
@@ -161,6 +176,14 @@ public static void main(String args[]) throws Exception {
debug = false;
}

// Older kernels do not have reliable madvise tag for this test to work.
// The first kernel version to work fine appears to be 4.15.
if (Platform.isLinux() &&
(Platform.getOsVersionMajor() < 4) ||
((Platform.getOsVersionMajor() == 4) && (Platform.getOsVersionMinor() < 15))) {
throw new SkippedException("Skipped for kernel: " + Platform.getOsVersion());
}

// Parse /proc/self/smaps to compare with values logged in the VM.
parseSmaps();

@@ -275,4 +298,4 @@ public String toString() {
return "[" + Long.toHexString(start) + ", " + Long.toHexString(end) + ") " +
"pageSize=" + pageSize + "KB isTHP=" + vmFlagHG + " isHUGETLB=" + vmFlagHT;
}
}
}