Request for Review of Backport of JDK-8083216: [TESTBUG] Fix tests for OS with 64K page size.

Ao Qi aoqi at loongson.cn
Thu Sep 13 05:41:35 UTC 2018


Hi,

Sorry for the wrong bug id in the last mail. JDK-8067941[1] and
JDK-8083216[2] are the same problem. I mixed them up. I think I should
use JDK-8067941.

[1] https://bugs.openjdk.java.net/browse/JDK-8067941
[2] https://bugs.openjdk.java.net/browse/JDK-8083216

Cheers,
Ao Qi
Ao Qi <aoqi at loongson.cn> 于2018年9月13日周四 下午1:31写道:
>
> Hi,
>
> I would like to get review and approval for 8u backport of JDK-8083216.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8067941
> Review Thread (jdk9):
> http://mail.openjdk.java.net/pipermail/hotspot-dev/2014-December/016564.html
> and http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-January/016623.html
> jdk9 changeset: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/719e28ccd7eb
>
> Goetz said that "The change should be downported to 8u60", but I did
> not found this backport in jdk8u/jdk8u. I am not sure if ppc64
> machines still have this demand for jdk8u. Some MIPS64 Linux is 16K
> page size, and some tests fail because of this.
>
> The jdk9 changeset can not be patched onto jdk8u. I made some modifications:
>
> ----------------------------------------------------------------------PATCH-------------------------------------------------
> jdk8u/hotspot$ hg diff
> diff -r 80ee2541504e src/share/vm/memory/metaspace.cpp
> --- a/src/share/vm/memory/metaspace.cpp Thu Aug 23 22:56:32 2018 +0000
> +++ b/src/share/vm/memory/metaspace.cpp Thu Sep 13 13:10:47 2018 +0800
> @@ -3875,11 +3875,13 @@
>        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);
> diff -r 80ee2541504e test/compiler/6865265/StackOverflowBug.java
> --- a/test/compiler/6865265/StackOverflowBug.java Thu Aug 23 22:56:32 2018 +0000
> +++ b/test/compiler/6865265/StackOverflowBug.java Thu Sep 13 13:10:47 2018 +0800
> @@ -28,7 +28,7 @@
>   * @summary JVM crashes with "missing exception handler" error
>   * @author volker.simonis at sap.com
>   *
> - * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss248k StackOverflowBug
> + * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss392k StackOverflowBug
>   */
>
>
> diff -r 80ee2541504e test/compiler/8009761/Test8009761.java
> --- a/test/compiler/8009761/Test8009761.java Thu Aug 23 22:56:32 2018 +0000
> +++ b/test/compiler/8009761/Test8009761.java Thu Sep 13 13:10:47 2018 +0800
> @@ -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 -Xss392K
> Test8009761
>   *
>   */
>
> diff -r 80ee2541504e
> test/compiler/exceptions/TestRecursiveReplacedException.java
> --- a/test/compiler/exceptions/TestRecursiveReplacedException.java Thu
> Aug 23 22:56:32 2018 +0000
> +++ b/test/compiler/exceptions/TestRecursiveReplacedException.java Thu
> Sep 13 13:10:47 2018 +0800
> @@ -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 -Xss392K
> TestRecursiveReplacedException
>   *
>   */
>
> diff -r 80ee2541504e test/compiler/uncommontrap/StackOverflowGuardPagesOff.java
> --- a/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java Thu
> Aug 23 22:56:32 2018 +0000
> +++ b/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java Thu
> Sep 13 13:10:47 2018 +0800
> @@ -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 -Xss392K
> -XX:-UseOnStackReplacement StackOverflowGuardPagesOff
>   *
>   */
>
> diff -r 80ee2541504e test/compiler/uncommontrap/TestStackBangMonitorOwned.java
> --- a/test/compiler/uncommontrap/TestStackBangMonitorOwned.java Thu
> Aug 23 22:56:32 2018 +0000
> +++ b/test/compiler/uncommontrap/TestStackBangMonitorOwned.java Thu
> Sep 13 13:10:47 2018 +0800
> @@ -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 -Xss392K
> -XX:-UseOnStackReplacement TestStackBangMonitorOwned
>   *
>   */
>  public class TestStackBangMonitorOwned {
> diff -r 80ee2541504e test/compiler/uncommontrap/TestStackBangRbp.java
> --- a/test/compiler/uncommontrap/TestStackBangRbp.java Thu Aug 23
> 22:56:32 2018 +0000
> +++ b/test/compiler/uncommontrap/TestStackBangRbp.java Thu Sep 13
> 13:10:47 2018 +0800
> @@ -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 -Xss392K
> -XX:-UseOnStackReplacement TestStackBangRbp
>   *
>   */
>  public class TestStackBangRbp {
> diff -r 80ee2541504e test/gc/arguments/TestMaxHeapSizeTools.java
> --- a/test/gc/arguments/TestMaxHeapSizeTools.java Thu Aug 23 22:56:32 2018 +0000
> +++ b/test/gc/arguments/TestMaxHeapSizeTools.java Thu Sep 13 13:10:47 2018 +0800
> @@ -112,7 +112,7 @@
>    }
>
>    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 {
> diff -r 80ee2541504e test/gc/g1/TestHumongousAllocInitialMark.java
> --- a/test/gc/g1/TestHumongousAllocInitialMark.java Thu Aug 23
> 22:56:32 2018 +0000
> +++ b/test/gc/g1/TestHumongousAllocInitialMark.java Thu Sep 13
> 13:10:47 2018 +0800
> @@ -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;  // %
>
> ----------------------------------------------------------------------PATCH
> ENDS-------------------------------------------------
> some new passed jtreg hotspot tests on MIPS 16K page size linux:
> gc/arguments/TestCMSHeapSizeFlags.java
> gc/arguments/TestParallelHeapSizeFlags.java
> gc/arguments/TestSerialHeapSizeFlags.java
> sanity/ExecuteInternalVMTests.java (fastdebug)
>
> Thanks,
> Ao Qi


More information about the jdk8u-dev mailing list