Skip to content

Commit

Permalink
8067941: [TESTBUG] Fix tests for OS with 64K page size.
Browse files Browse the repository at this point in the history
Reviewed-by: andrew
Backport-of: 8e2df5f543522866e7c27ff95ea6fb6458393682
  • Loading branch information
Dongbo He authored and gnu-andrew committed Sep 1, 2022
1 parent 9f037b0 commit fa340ab
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 11 deletions.
8 changes: 5 additions & 3 deletions hotspot/src/share/vm/memory/metaspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3937,11 +3937,13 @@ class TestVirtualSpaceNodeTest {
assert(cm.sum_free_chunks() == 2*MediumChunk, "sizes should add up");
}

{ // 4 pages of VSN is committed, some is used by chunks
const size_t page_chunks = 4 * (size_t)os::vm_page_size() / BytesPerWord;
// This doesn't work for systems with vm_page_size >= 16K.
if (page_chunks < MediumChunk) {
// 4 pages of VSN is committed, some is used by chunks
ChunkManager cm(SpecializedChunk, SmallChunk, MediumChunk);
VirtualSpaceNode vsn(vsn_test_size_bytes);
const size_t page_chunks = 4 * (size_t)os::vm_page_size() / BytesPerWord;
assert(page_chunks < MediumChunk, "Test expects medium chunks to be at least 4*page_size");

vsn.initialize();
vsn.expand_by(page_chunks, page_chunks);
vsn.get_chunk_vs(SmallChunk);
Expand Down
2 changes: 1 addition & 1 deletion hotspot/test/compiler/6865265/StackOverflowBug.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @summary JVM crashes with "missing exception handler" error
* @author volker.simonis@sap.com
*
* @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss248k StackOverflowBug
* @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss512k StackOverflowBug
*/


Expand Down
2 changes: 1 addition & 1 deletion hotspot/test/compiler/8009761/Test8009761.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @test
* @bug 8009761
* @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
* @run main/othervm -XX:CompileCommand=exclude,Test8009761::m2 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss256K Test8009761
* @run main/othervm -XX:CompileCommand=exclude,Test8009761::m2 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss512K Test8009761
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @test
* @bug 8054224
* @summary Recursive method compiled by C1 is unable to catch StackOverflowError
* @run main/othervm -Xcomp -XX:CompileOnly=Test.run -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss256K TestRecursiveReplacedException
* @run main/othervm -Xcomp -XX:CompileOnly=Test.run -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss512K TestRecursiveReplacedException
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @test
* @bug 8029383
* @summary stack overflow if callee is marked for deoptimization causes crash
* @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,StackOverflowGuardPagesOff::m1 -XX:CompileCommand=exclude,StackOverflowGuardPagesOff::m2 -Xss256K -XX:-UseOnStackReplacement StackOverflowGuardPagesOff
* @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,StackOverflowGuardPagesOff::m1 -XX:CompileCommand=exclude,StackOverflowGuardPagesOff::m2 -Xss512K -XX:-UseOnStackReplacement StackOverflowGuardPagesOff
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @test
* @bug 8032410
* @summary Stack overflow at deoptimization doesn't release owned monitors
* @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangMonitorOwned::m1 -XX:CompileCommand=exclude,TestStackBangMonitorOwned::m2 -Xss256K -XX:-UseOnStackReplacement TestStackBangMonitorOwned
* @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangMonitorOwned::m1 -XX:CompileCommand=exclude,TestStackBangMonitorOwned::m2 -Xss512K -XX:-UseOnStackReplacement TestStackBangMonitorOwned
*
*/
public class TestStackBangMonitorOwned {
Expand Down
2 changes: 1 addition & 1 deletion hotspot/test/compiler/uncommontrap/TestStackBangRbp.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @test
* @bug 8028308
* @summary rbp not restored when stack overflow is thrown from deopt/uncommon trap blobs
* @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangRbp::m1 -XX:CompileCommand=exclude,TestStackBangRbp::m2 -Xss256K -XX:-UseOnStackReplacement TestStackBangRbp
* @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangRbp::m1 -XX:CompileCommand=exclude,TestStackBangRbp::m2 -Xss512K -XX:-UseOnStackReplacement TestStackBangRbp
*
*/
public class TestStackBangRbp {
Expand Down
2 changes: 1 addition & 1 deletion hotspot/test/gc/arguments/TestMaxHeapSizeTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static void checkGenMaxHeapErgo(String gcflag) throws Exception {
}

private static void checkInvalidMinInitialHeapCombinations(String gcflag) throws Exception {
expectError(new String[] { gcflag, "-Xms8M", "-XX:InitialHeapSize=4M", "-version" });
expectError(new String[] { gcflag, "-Xms64M", "-XX:InitialHeapSize=32M", "-version" });
}

private static void checkValidMinInitialHeapCombinations(String gcflag) throws Exception {
Expand Down
4 changes: 3 additions & 1 deletion hotspot/test/gc/g1/TestHumongousAllocInitialMark.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import com.oracle.java.testlibrary.*;

public class TestHumongousAllocInitialMark {
private static final int heapSize = 200; // MB
// Heap sizes < 224 MB are increased to 224 MB if vm_page_size == 64K to
// fulfill alignment constraints.
private static final int heapSize = 224; // MB
private static final int heapRegionSize = 1; // MB
private static final int initiatingHeapOccupancyPercent = 50; // %

Expand Down

1 comment on commit fa340ab

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.