author | tschatzl |
Tue, 19 Jul 2016 10:31:41 +0200 | |
changeset 39979 | b17e445924da |
parent 39414 | 4adf52148100 |
child 40631 | ed82623d7831 |
permissions | -rw-r--r-- |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
1 |
/* |
39414
4adf52148100
8160088: update hotspot tests depending on GC to use @requires vm.gc.X
dfazunen
parents:
36851
diff
changeset
|
2 |
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
4 |
* |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
8 |
* |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
13 |
* accompanied this code). |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
14 |
* |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
18 |
* |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
21 |
* questions. |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
22 |
*/ |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
23 |
|
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
24 |
/* |
35061 | 25 |
* @test TestRemsetLoggingThreads |
39414
4adf52148100
8160088: update hotspot tests depending on GC to use @requires vm.gc.X
dfazunen
parents:
36851
diff
changeset
|
26 |
* @requires vm.gc.G1 |
35189
a69874af6697
8145534: TestRemsetLogging.java takes a long time
tschatzl
parents:
35061
diff
changeset
|
27 |
* @bug 8025441 8145534 |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
28 |
* @key gc |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
29 |
* @library /testlibrary |
36851 | 30 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
27153
diff
changeset
|
31 |
* java.management/sun.management |
35189
a69874af6697
8145534: TestRemsetLogging.java takes a long time
tschatzl
parents:
35061
diff
changeset
|
32 |
* @summary Ensure that various values of worker threads/concurrent |
a69874af6697
8145534: TestRemsetLogging.java takes a long time
tschatzl
parents:
35061
diff
changeset
|
33 |
* refinement threads do not crash the VM. |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
34 |
*/ |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
35 |
|
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
36 |
import java.util.regex.Matcher; |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
37 |
import java.util.regex.Pattern; |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
38 |
|
30604
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
39 |
import jdk.test.lib.ProcessTools; |
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
40 |
import jdk.test.lib.OutputAnalyzer; |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
41 |
|
35061 | 42 |
public class TestRemsetLoggingThreads { |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
43 |
|
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
44 |
private static void runTest(int refinementThreads, int workerThreads) throws Exception { |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
45 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
46 |
"-XX:+UnlockDiagnosticVMOptions", |
35061 | 47 |
"-Xlog:gc+remset+exit=trace", |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
48 |
"-XX:G1ConcRefinementThreads=" + refinementThreads, |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
49 |
"-XX:ParallelGCThreads=" + workerThreads, |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
50 |
"-version"); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
51 |
|
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
52 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
53 |
|
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
54 |
// a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used. |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
55 |
// Additionally use at least one thread. |
27153
078af0a29311
8060116: After JDK-8047976 gc/g1/TestSummarizeRSetStatsThreads fails
mlarsson
parents:
20310
diff
changeset
|
56 |
int expectedNumRefinementThreads = refinementThreads; |
078af0a29311
8060116: After JDK-8047976 gc/g1/TestSummarizeRSetStatsThreads fails
mlarsson
parents:
20310
diff
changeset
|
57 |
|
35061 | 58 |
String pattern = "Concurrent RS threads times \\(s\\)$"; |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
59 |
Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout()); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
60 |
|
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
61 |
if (!m.find()) { |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
62 |
throw new Exception("Could not find correct output for concurrent RS threads times in stdout," + |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
63 |
" should match the pattern \"" + pattern + "\", but stdout is \n" + output.getStdout()); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
64 |
} |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
65 |
output.shouldHaveExitValue(0); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
66 |
} |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
67 |
|
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
68 |
public static void main(String[] args) throws Exception { |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
69 |
// different valid combinations of number of refinement and gc worker threads |
27153
078af0a29311
8060116: After JDK-8047976 gc/g1/TestSummarizeRSetStatsThreads fails
mlarsson
parents:
20310
diff
changeset
|
70 |
runTest(1, 1); |
078af0a29311
8060116: After JDK-8047976 gc/g1/TestSummarizeRSetStatsThreads fails
mlarsson
parents:
20310
diff
changeset
|
71 |
runTest(1, 5); |
078af0a29311
8060116: After JDK-8047976 gc/g1/TestSummarizeRSetStatsThreads fails
mlarsson
parents:
20310
diff
changeset
|
72 |
runTest(5, 1); |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
73 |
runTest(10, 10); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
74 |
runTest(1, 2); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
75 |
runTest(4, 3); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
76 |
} |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
diff
changeset
|
77 |
} |