Skip to content

Commit 2583feb

Browse files
author
Thomas Schatzl
committed
8290023: Remove use of IgnoreUnrecognizedVMOptions in gc tests
Reviewed-by: ayang, lkorinth, kbarrett
1 parent 44fb92e commit 2583feb

13 files changed

+258
-74
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;
@@ -105,19 +109,22 @@ static void checkBitmap(OutputAnalyzer output, long expectedPageSize) throws Exc
105109
checkSize(output, expectedPageSize, "Mark Bitmap: .*page_size=([^ ]+)");
106110
}
107111

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

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

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

143143
output = new OutputAnalyzer(pb.start());
144144
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/g1/TestVerificationInConcurrentCycle.java

+20-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
/*
2727
* @test TestVerificationInConcurrentCycle
2828
* @requires vm.gc.G1
29+
* @requires vm.debug
2930
* @summary Basic testing of various GC pause verification during the G1 concurrent cycle.
3031
* @library /test/lib
3132
* @build jdk.test.whitebox.WhiteBox
@@ -36,7 +37,25 @@
3637
* -XX:+VerifyBeforeGC -XX:+VerifyDuringGC -XX:+VerifyAfterGC
3738
* -XX:+G1VerifyRSetsDuringFullGC -XX:+G1VerifyHeapRegionCodeRoots
3839
* -XX:+VerifyRememberedSets -XX:+VerifyObjectStartArray
39-
* -XX:+IgnoreUnrecognizedVMOptions -XX:+G1VerifyBitmaps
40+
* -XX:+G1VerifyBitmaps
41+
* gc.g1.TestVerificationInConcurrentCycle
42+
*/
43+
44+
/*
45+
* @test TestVerificationInConcurrentCycle
46+
* @requires vm.gc.G1
47+
* @requires !vm.debug
48+
* @summary Basic testing of various GC pause verification during the G1 concurrent cycle. It leaves
49+
* out G1VerifyBitmaps as this is a debug-only option.
50+
* @library /test/lib
51+
* @build sun.hotspot.WhiteBox
52+
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
53+
* @run main/othervm
54+
* -Xbootclasspath/a:.
55+
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
56+
* -XX:+VerifyBeforeGC -XX:+VerifyDuringGC -XX:+VerifyAfterGC
57+
* -XX:+G1VerifyRSetsDuringFullGC -XX:+G1VerifyHeapRegionCodeRoots
58+
* -XX:+VerifyRememberedSets -XX:+VerifyObjectStartArray
4059
* gc.g1.TestVerificationInConcurrentCycle
4160
*/
4261

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @library /test/lib
3333
* @modules java.base/jdk.internal.misc
3434
* java.management
35-
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=48m gc.metaspace.CompressedClassSpaceSizeInJmapHeap
35+
* @run main/othervm -XX:CompressedClassSpaceSize=48m gc.metaspace.CompressedClassSpaceSizeInJmapHeap
3636
*/
3737

3838
import jdk.test.lib.JDKToolLauncher;

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)