Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263915: runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails when UseCompressedClassPointers is off #3110

Closed
wants to merge 2 commits into from

Conversation

@DamonFool
Copy link
Member

@DamonFool DamonFool commented Mar 22, 2021

Hi all,

runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails on x86_32 due to failure of this check [1].
However, this check will always fail if UseCompressedClassPointers=0 [2] (e.g., on x86_32) since the class_space_rs remains unreserved.
It would be better to fix it.

Thanks.
Best regards,
Jie

[1] https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java#L66
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/memory/metaspaceShared.cpp#L1141


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8263915: runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails when UseCompressedClassPointers is off

Reviewers

Download

To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3110/head:pull/3110
$ git checkout pull/3110

To update a local copy of the PR:
$ git checkout pull/3110
$ git pull https://git.openjdk.java.net/jdk pull/3110/head

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Mar 22, 2021

/issue add JDK-8263915
/test
/label add hotspot-runtime
/cc hotspot-runtime

Loading

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 22, 2021

👋 Welcome back jiefu! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

Loading

@openjdk openjdk bot added the rfr label Mar 22, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 22, 2021

@DamonFool This issue is referenced in the PR title - it will now be updated.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Mar 22, 2021

@DamonFool
The hotspot-runtime label was successfully added.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Mar 22, 2021

@DamonFool The hotspot-runtime label was already applied.

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 22, 2021

Webrevs

Loading

Copy link
Member

@tstuefe tstuefe left a comment

Hi Jie,

I think it would be better to couple this not to bitness but directly to UseCompressedClassPointers. The test should also work if we run it with a 64bit VM with compressed class pointers off.

To keep matters simple, I think one could even match either pattern always instead of making it dependent on CompressedClassPointers, but I leave this up to the CDS guys.

Thanks, Thomas

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Mar 22, 2021

The test should also work if we run it with a 64bit VM with compressed class pointers off.

Good catch.
Thanks @tstuefe for your review.

Okay, let's wait for the comments from the CDS experts.
Thanks.

Loading

@DamonFool DamonFool changed the title 8263915: runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails on x86_32 8263915: runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails when UseCompressedClassPointers is off Mar 22, 2021
@yminqi
Copy link
Contributor

@yminqi yminqi commented Mar 22, 2021

Hi Jie,

I think it would be better to couple this not to bitness but directly to UseCompressedClassPointers. The test should also work if we run it with a 64bit VM with compressed class pointers off.

To keep matters simple, I think one could even match either pattern always instead of making it dependent on CompressedClassPointers, but I leave this up to the CDS guys.

Thanks, Thomas

Hi, Thomas, Jie
On 32bit platform, UseCompressedOops/UseCompressedClassPointers do not exist. So checking for that flag is a little different I think. @DamonFool , could you try to use WhiteBox.getBooleanVMFlag("UseCompressedClassPointers") to check this flag? If it does not exists, it should return null, or it is true/false. This way, you can have two patterns to check again the result.

Thanks
Yumin

Loading

@iklam
Copy link
Member

@iklam iklam commented Mar 22, 2021

Hi Jie,
I think it would be better to couple this not to bitness but directly to UseCompressedClassPointers. The test should also work if we run it with a 64bit VM with compressed class pointers off.
To keep matters simple, I think one could even match either pattern always instead of making it dependent on CompressedClassPointers, but I leave this up to the CDS guys.
Thanks, Thomas

Hi, Thomas, Jie
On 32bit platform, UseCompressedOops/UseCompressedClassPointers do not exist. So checking for that flag is a little different I think. @DamonFool , could you try to use WhiteBox.getBooleanVMFlag("UseCompressedClassPointers") to check this flag? If it does not exists, it should return null, or it is true/false. This way, you can have two patterns to check again the result.

Thanks
Yumin

I think the test just needs to find out that the following function is called to release memory:

void MetaspaceShared::release_reserved_spaces(ReservedSpace& total_space_rs,
                                              ReservedSpace& archive_space_rs,
                                              ReservedSpace& class_space_rs) {
  if (total_space_rs.is_reserved()) {
    log_debug(cds)("Released shared space (archive + class) " INTPTR_FORMAT, p2i(total_space_rs.base()));
    total_space_rs.release();
  } else {
    if (archive_space_rs.is_reserved()) {
      log_debug(cds)("Released shared space (archive) " INTPTR_FORMAT, p2i(archive_space_rs.base()));
      archive_space_rs.release();
    }
    if (class_space_rs.is_reserved()) {
      log_debug(cds)("Released shared space (classes) " INTPTR_FORMAT, p2i(class_space_rs.base()));
      class_space_rs.release();
    }
  }
}

Note that the first log_debug is not always called. For example: the test fails even on 64-bit platforms if you run with:

jtreg -vmoptions:-XX:-UseCompressedClassPointers \
    MismatchedPathTriggerMemoryRelease.java

Also, if (use_windows_memory_mapping() && use_archive_base_addr) is true, total_space_rs is not reserved.

I think we can relax the regexp to something like this so that the test is more resilient:

        "Released shared space .* 0(x|X)[0-9a-fA-F]+$";

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Mar 22, 2021

Thanks @yminqi and @iklam for your review and comments.

I think @iklam 's suggestion is reasonable and simple enough.
Updated and testing on x64/x86 passed.
Thanks.

Loading

yminqi
yminqi approved these changes Mar 23, 2021
Copy link
Contributor

@yminqi yminqi left a comment

LGTM.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Mar 23, 2021

@DamonFool This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8263915: runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails when UseCompressedClassPointers is off

Reviewed-by: minqi

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 14 new commits pushed to the master branch:

  • a5e7a89: 8263904: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails on x86_32
  • f62b100: 8263895: Test nsk/jvmti/GetThreadGroupChildren/getthrdgrpchld001/getthrdgrpchld001.cpp uses incorrect indices
  • f84b52b: 8263897: compiler/c2/aarch64/TestVolatilesSerial.java failed with "java.lang.RuntimeException: Wrong method"
  • f08bf4b: 8263891: Changes for 8076985 missed the fix.
  • b2df513: 8261785: Calling "main" method in anonymous nested class crashes the JVM
  • 840ab7b: 8263894: Convert defaultPrinter and printers fields to local variables
  • ba504fc: 8187450: JNI local refs exceeds capacity warning in NetworkInterface::getAll
  • 0abbfb2: 8263729: [test] divert spurious output away from stream under test in ProcessBuilder Basic test
  • 6c2220e: 8263861: Shenandoah: Remove unused member in ShenandoahGCStateResetter
  • 5262d95: 8263855: Use the blessed modifier order in java.management/naming
  • ... and 4 more: https://git.openjdk.java.net/jdk/compare/35cd9456b9266579a8496130570eb2ea7f9254d9...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

Loading

@openjdk openjdk bot added the ready label Mar 23, 2021
@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Mar 23, 2021

Thanks @yminqi for your review.
/integrate

Loading

@openjdk openjdk bot closed this Mar 23, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Mar 23, 2021
@DamonFool DamonFool deleted the JDK-8263915 branch Mar 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 23, 2021

@DamonFool Since your change was applied there have been 26 commits pushed to the master branch:

  • 2da882c: 8262465: Very long compilation times and high memory consumption in C2 debug builds
  • 0b03d04: 8167015: compiler/codecache/jmx/PoolsIndependenceTest.java timeout
  • df01b15: 8263977: GTK L&F: Cleanup duplicate checks in GTKStyle and GTKLookAndFeel
  • 57d8f1d: 8263985: BCEscapeAnalyzer::invoke checks target->is_loaded() twice
  • 4ef7c67: 8263979: Cleanup duplicate check in Unicode.contains
  • 289d48a: 8261673: Move javadoc for the lookup mechanism to module-info
  • 7b6efd3: 8263904: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails on x86_32
  • 036ae0e: 8225438: javax/net/ssl/TLSCommon/TestSessionLocalPrincipal.java failed with Read timed out
  • 5a51d70: 8247895: SHA1PRNGReseed.java is calling setSeed(0)
  • b2a52ea: 8263342: Add --connect option to jhsdb hsdb/clhsdb
  • ... and 16 more: https://git.openjdk.java.net/jdk/compare/35cd9456b9266579a8496130570eb2ea7f9254d9...master

Your commit was automatically rebased without conflicts.

Pushed as commit 7b81f8e.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants