8202152: test/hotspot/jtreg/runtime/whitebox/WBStackSize.java fails
authorkvn
Wed, 25 Apr 2018 10:12:45 -0700
changeset 49888 314038828101
parent 49887 39446351e625
child 49889 4de5ca97feee
8202152: test/hotspot/jtreg/runtime/whitebox/WBStackSize.java fails Summary: set compiler threads stack size the same as for java threads Reviewed-by: dholmes, mdoerr, dlong
test/hotspot/jtreg/runtime/whitebox/WBStackSize.java
--- a/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java	Wed Apr 25 09:45:45 2018 -0700
+++ b/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java	Wed Apr 25 10:12:45 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,8 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xss512k WBStackSize
+ * @comment Must use the same stacksize for Java threads and compiler threads in case of thread recycling
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xss512k -XX:CompilerThreadStackSize=512 WBStackSize
  */
 
 /*
@@ -82,9 +83,7 @@
     }
 
     public static void main(String[] args) {
-        boolean isCompilerThread = Thread.currentThread().getName().indexOf(" CompilerThread") > 0;
-        long configStackSize = isCompilerThread ? wb.getIntxVMFlag("CompilerThreadStackSize") * K
-                                                : wb.getIntxVMFlag("ThreadStackSize") * K;
+        long configStackSize = wb.getIntxVMFlag("ThreadStackSize") * K;
         System.out.println("ThreadStackSize VM option: " + configStackSize);
 
         long stackProtectionSize = wb.getIntxVMFlag("StackShadowPages") * wb.getVMPageSize();
@@ -95,7 +94,7 @@
 
         if (Math.abs(actualStackSize - configStackSize) > configStackSize * 0.1) {
             throw new RuntimeException("getThreadFullStackSize value [" + actualStackSize
-                                     + "] should be within 90%..110% of the value returned by HotSpotDiagnosticMXBean");
+                                     + "] should be within 90%..110% of ThreadStackSize value");
         }
 
         long remainingStackSize = wb.getThreadRemainingStackSize();