Skip to content

Commit 7d0a5c7

Browse files
committed
8290023: Remove use of IgnoreUnrecognizedVMOptions in gc tests
8290269: gc/shenandoah/TestVerifyJCStress.java fails due to invalid tag: required after JDK-8290023 Reviewed-by: phh Backport-of: 2583feb21bf5419afc3c1953d964cf89d65fe8a2
1 parent 594ce95 commit 7d0a5c7

11 files changed

+237
-72
lines changed

test/hotspot/jtreg/gc/TestObjectAlignment.java

+13-20
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,29 @@
2626
/**
2727
* @test TestObjectAlignment
2828
* @bug 8021823
29+
* @requires vm.bits == "64"
2930
* @summary G1: Concurrent marking crashes with -XX:ObjectAlignmentInBytes>=32 in 64bit VMs
3031
* @library /test/lib
3132
* @modules java.base/jdk.internal.misc
32-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=8
33-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
34-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32
35-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=64
36-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=128
37-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=256
38-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=8
39-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
40-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32
41-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=64
42-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=128
43-
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=256
33+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=8
34+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=16
35+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=32
36+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=64
37+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=128
38+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=256
39+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=8
40+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=16
41+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=32
42+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=64
43+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=128
44+
* @run main/othervm gc.TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:ObjectAlignmentInBytes=256
4445
*/
4546

4647
public class TestObjectAlignment {
4748

4849
public static byte[] garbage;
4950

50-
private static boolean runsOn32bit() {
51-
return System.getProperty("sun.arch.data.model").equals("32");
52-
}
53-
5451
public static void main(String[] args) throws Exception {
55-
if (runsOn32bit()) {
56-
// 32 bit VMs do not allow setting ObjectAlignmentInBytes, so there is nothing to test. We still get called.
57-
return;
58-
}
5952
for (int i = 0; i < 10; i++) {
6053
garbage = new byte[1000];
6154
System.gc();

test/hotspot/jtreg/gc/epsilon/TestAlignment.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,22 @@
3636
* @run main/othervm -Xmx64m -XX:-UseTLAB
3737
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
3838
* gc.epsilon.TestAlignment
39-
*
39+
*/
40+
41+
/**
42+
* @test TestAlignment
43+
* @requires vm.gc.Epsilon
44+
* @requires vm.bits == "64"
45+
* @summary Check Epsilon TLAB options with unusual object alignment
46+
* @bug 8212177
4047
* @run main/othervm -Xmx64m -XX:+UseTLAB
4148
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
42-
* -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
49+
* -XX:ObjectAlignmentInBytes=16
4350
* gc.epsilon.TestAlignment
4451
*
4552
* @run main/othervm -Xmx64m -XX:-UseTLAB
4653
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
47-
* -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
54+
* -XX:ObjectAlignmentInBytes=16
4855
* gc.epsilon.TestAlignment
4956
*/
5057

test/hotspot/jtreg/gc/epsilon/TestMaxTLAB.java

+12-5
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,36 @@
4848
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
4949
* -XX:EpsilonMaxTLABSize=12345
5050
* gc.epsilon.TestMaxTLAB
51-
*
51+
*/
52+
53+
/**
54+
* @test TestMaxTLAB
55+
* @requires vm.gc.Epsilon
56+
* @requires vm.bits == "64"
57+
* @summary Check EpsilonMaxTLAB options
58+
* @bug 8212177
5259
* @run main/othervm -Xmx64m
5360
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
5461
* -XX:EpsilonMaxTLABSize=1
55-
* -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
62+
* -XX:ObjectAlignmentInBytes=16
5663
* gc.epsilon.TestMaxTLAB
5764
*
5865
* @run main/othervm -Xmx64m
5966
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
6067
* -XX:EpsilonMaxTLABSize=1K
61-
* -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
68+
* -XX:ObjectAlignmentInBytes=16
6269
* gc.epsilon.TestMaxTLAB
6370
*
6471
* @run main/othervm -Xmx64m
6572
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
6673
* -XX:EpsilonMaxTLABSize=1M
67-
* -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
74+
* -XX:ObjectAlignmentInBytes=16
6875
* gc.epsilon.TestMaxTLAB
6976
*
7077
* @run main/othervm -Xmx64m
7178
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
7279
* -XX:EpsilonMaxTLABSize=12345
73-
* -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
80+
* -XX:ObjectAlignmentInBytes=16
7481
* gc.epsilon.TestMaxTLAB
7582
*/
7683

test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* mark bitmaps at reclaim.
3131
* @key randomness
3232
* @requires vm.gc.G1
33+
* @requires vm.debug
3334
* @library /test/lib
3435
* @modules java.base/jdk.internal.misc
3536
* java.management
@@ -129,7 +130,6 @@ public static void main(String[] args) throws Exception {
129130
"-XX:+UnlockDiagnosticVMOptions",
130131
"-XX:+VerifyAfterGC",
131132
"-XX:ConcGCThreads=1", // Want to make marking as slow as possible.
132-
"-XX:+IgnoreUnrecognizedVMOptions", // G1VerifyBitmaps is develop only.
133133
"-XX:+G1VerifyBitmaps",
134134
TestEagerReclaimHumongousRegionsClearMarkBitsReclaimRegionFast.class.getName());
135135
OutputAnalyzer output = new OutputAnalyzer(pb.start());

test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java

+18-18
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,21 @@
3333
* @requires vm.opt.LargePageSizeInBytes == null
3434
* @build jdk.test.whitebox.WhiteBox
3535
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
36-
* @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages gc.g1.TestLargePageUseForAuxMemory
36+
* @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseLargePages gc.g1.TestLargePageUseForAuxMemory
3737
*/
3838

39+
import java.util.ArrayList;
40+
import java.util.List;
3941
import java.lang.Math;
42+
import java.util.Collections;
4043
import jdk.test.lib.process.OutputAnalyzer;
4144
import jdk.test.lib.process.ProcessTools;
4245
import jdk.test.lib.Asserts;
4346
import jdk.test.lib.Platform;
44-
import jtreg.SkippedException;
4547
import jdk.test.whitebox.WhiteBox;
4648

49+
import jtreg.SkippedException;
50+
4751
public class TestLargePageUseForAuxMemory {
4852
static final long HEAP_REGION_SIZE = 1 * 1024 * 1024;
4953
static long largePageSize;
@@ -106,19 +110,22 @@ static void checkBitmaps(OutputAnalyzer output, long expectedPageSize) throws Ex
106110
checkSize(output, expectedPageSize, "Next Bitmap: .*page_size=([^ ]+)");
107111
}
108112

113+
static List<String> getOpts(long heapsize, boolean largePageEnabled) {
114+
return List.of("-XX:+UseG1GC",
115+
"-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE,
116+
"-Xmx" + heapsize,
117+
"-Xlog:pagesize,gc+init,gc+heap+coops=debug",
118+
"-XX:" + (largePageEnabled ? "+" : "-") + "UseLargePages",
119+
"-version");
120+
}
121+
109122
static void testVM(String what, long heapsize, boolean cardsShouldUseLargePages, boolean bitmapShouldUseLargePages) throws Exception {
110123
System.out.println(what + " heapsize " + heapsize + " card table should use large pages " + cardsShouldUseLargePages + " " +
111124
"bitmaps should use large pages " + bitmapShouldUseLargePages);
112125
ProcessBuilder pb;
126+
113127
// Test with large page enabled.
114-
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
115-
"-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE,
116-
"-Xmx" + heapsize,
117-
"-Xlog:pagesize,gc+init,gc+heap+coops=debug",
118-
"-XX:+UseLargePages",
119-
"-XX:+IgnoreUnrecognizedVMOptions", // there is no ObjectAlignmentInBytes in 32 bit builds
120-
"-XX:ObjectAlignmentInBytes=8",
121-
"-version");
128+
pb = ProcessTools.createJavaProcessBuilder(getOpts(heapsize, true));
122129

123130
OutputAnalyzer output = new OutputAnalyzer(pb.start());
124131
// Only expect large page size if large pages are enabled.
@@ -132,14 +139,7 @@ static void testVM(String what, long heapsize, boolean cardsShouldUseLargePages,
132139
output.shouldHaveExitValue(0);
133140

134141
// Test with large page disabled.
135-
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
136-
"-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE,
137-
"-Xmx" + heapsize,
138-
"-Xlog:pagesize",
139-
"-XX:-UseLargePages",
140-
"-XX:+IgnoreUnrecognizedVMOptions", // there is no ObjectAlignmentInBytes in 32 bit builds
141-
"-XX:ObjectAlignmentInBytes=8",
142-
"-version");
142+
pb = ProcessTools.createJavaProcessBuilder(getOpts(heapsize, false));
143143

144144
output = new OutputAnalyzer(pb.start());
145145
checkSmallTables(output, smallPageSize);

test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @build jdk.test.whitebox.WhiteBox
3535
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
3636
* @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
37-
-XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages gc.g1.TestLargePageUseForHeap
37+
-XX:+UseLargePages gc.g1.TestLargePageUseForHeap
3838
*/
3939

4040
import jdk.test.lib.process.OutputAnalyzer;

test/hotspot/jtreg/gc/metaspace/TestMetaspaceMemoryPool.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@
3737
* @library /
3838
* @modules java.base/jdk.internal.misc
3939
* java.management
40-
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops gc.metaspace.TestMetaspaceMemoryPool
41-
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m gc.metaspace.TestMetaspaceMemoryPool
42-
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers gc.metaspace.TestMetaspaceMemoryPool
43-
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=60m gc.metaspace.TestMetaspaceMemoryPool
40+
* @run main/othervm -XX:-UseCompressedOops gc.metaspace.TestMetaspaceMemoryPool
41+
* @run main/othervm -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m gc.metaspace.TestMetaspaceMemoryPool
42+
* @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers gc.metaspace.TestMetaspaceMemoryPool
43+
* @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=60m gc.metaspace.TestMetaspaceMemoryPool
4444
*/
45+
4546
public class TestMetaspaceMemoryPool {
4647
public static void main(String[] args) {
4748
verifyThatMetaspaceMemoryManagerExists();

0 commit comments

Comments
 (0)