8163363: AArch64: Stack size in tools/launcher/Settings.java needs to be adjusted

Specify a proper min stack size input to -Xss for aarch64

Reviewed-by: aph
This commit is contained in:
Patrick Zhang 2019-04-09 18:46:51 +08:00
parent 4a9f7612be
commit c6497e3f25

@ -68,6 +68,7 @@ public class Settings extends TestHelper {
private static final String PROP_SETTINGS = "Property settings:";
private static final String LOCALE_SETTINGS = "Locale settings:";
private static final String SYSTEM_SETTINGS = "Operating System Metrics:";
private static final String STACKSIZE_SETTINGS = "Stack Size:";
static void containsAllOptions(TestResult tr) {
checkContains(tr, VM_SETTINGS);
@ -82,10 +83,22 @@ public class Settings extends TestHelper {
int stackSize = 256; // in kb
if (getArch().equals("ppc64") || getArch().equals("ppc64le")) {
stackSize = 800;
} else if (getArch().equals("aarch64")) {
/*
* The max value of minimum stack size allowed for aarch64 can be estimated as
* such: suppose the vm page size is 64KB and the test runs with a debug build,
* the initial _java_thread_min_stack_allowed defined in os_linux_aarch64.cpp is
* 72K, stack guard zones could take 192KB, and the shadow zone needs 128KB,
* after aligning up all parts to the page size, the final size would be 448KB.
* See details in JDK-8163363
*/
stackSize = 448;
}
TestResult tr;
tr = doExec(javaCmd, "-Xms64m", "-Xmx512m",
"-Xss" + stackSize + "k", "-XshowSettings", "-jar", testJar.getAbsolutePath());
// Check the stack size logs printed by -XshowSettings to verify -Xss meaningfully.
checkContains(tr, STACKSIZE_SETTINGS);
containsAllOptions(tr);
if (!tr.isOK()) {
System.out.println(tr);
@ -93,6 +106,7 @@ public class Settings extends TestHelper {
}
tr = doExec(javaCmd, "-Xms65536k", "-Xmx712m",
"-Xss" + (stackSize * 1024), "-XshowSettings", "-jar", testJar.getAbsolutePath());
checkContains(tr, STACKSIZE_SETTINGS);
containsAllOptions(tr);
if (!tr.isOK()) {
System.out.println(tr);