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

8333047: Remove arena-size-workaround in jvmtiUtils.cpp #19425

Conversation

tstuefe
Copy link
Member

@tstuefe tstuefe commented May 28, 2024

In JvmtiUtil::single_threaded_resource_area(), we create a resource area that is supposed to work even if the current thread is not attached yet and there is no associated Thread or the Thread has no valid ResourceArea.

It contains a workaround:

    // lazily create the single threaded resource area
    // pick a size which is not a standard since the pools don't exist yet
    _single_threaded_resource_area = new (mtInternal) ResourceArea(Chunk::non_pool_size);

It specifies a non-standard chunk size to circumvent the chunk-pool-based allocation in the RA constructor, ensuring that only malloc is used. This is because in the old days the ChunkPools had been allocated from C-Heap and there was a time window when no chunk pools were live yet.

This is quirky and a bit ugly. It is also unnecessary since JDK-8272112 (since JDK 18). We now create chunk pools as global objects, so they are live as soon as the libjvm C++ initialization ran. We can remove this workaround and the comment.


Tests: GHAs.
I also manually called this function, and allocated from the resulting ResourceArea, at the very beginning of CreateJavaVM. I made sure that both allocations and follow-up-chunk-allocation worked even this early in VM life.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8333047: Remove arena-size-workaround in jvmtiUtils.cpp (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19425/head:pull/19425
$ git checkout pull/19425

Update a local copy of the PR:
$ git checkout pull/19425
$ git pull https://git.openjdk.org/jdk.git pull/19425/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19425

View PR using the GUI difftool:
$ git pr show -t 19425

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19425.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 28, 2024

👋 Welcome back stuefe! 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.

@openjdk
Copy link

openjdk bot commented May 28, 2024

@tstuefe 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:

8333047: Remove arena-size-workaround in jvmtiUtils.cpp

Reviewed-by: jsjolen, sspitsyn

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 44 new commits pushed to the master branch:

  • 6d718ae: 8324341: Remove redundant preprocessor #if's checks
  • 9b64ece: 8332904: ubsan ppc64le: c1_LIRGenerator_ppc.cpp:581:21: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long int'
  • 3d4eb15: 8302744: Refactor Hotspot container detection code
  • 2cca83b: 8332880: JFR GCHelper class recognizes "Archive" regions as valid
  • b8ae11e: 8332960: ubsan: classListParser.hpp:159:12: runtime error: load of value 2101478704, which is not a valid value for type 'ParseMode'
  • 9a83dfe: 8332431: NullPointerException in JTable of SwingSet2
  • 01060ad: 8325083: jdk/incubator/vector/Double512VectorTests.java crashes in Assembler::vex_prefix_and_encode
  • 673f767: 8285506: Unify os::vsnprintf implementations
  • 91ab088: 8333116: test/jdk/tools/jpackage/share/ServiceTest.java test fails
  • 9ac8d05: 8332228: TypePollution.java: Unrecognized VM option 'UseSecondarySuperCache'
  • ... and 34 more: https://git.openjdk.org/jdk/compare/08d51003d142e89b9d2f66187a4ea50e12b94fbb...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.

@openjdk openjdk bot changed the title JDK-8333047: Remove arena-size-workaround in jvmtiUtils.cpp 8333047: Remove arena-size-workaround in jvmtiUtils.cpp May 28, 2024
@openjdk
Copy link

openjdk bot commented May 28, 2024

@tstuefe The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels May 28, 2024
@tstuefe tstuefe marked this pull request as ready for review May 28, 2024 13:35
@openjdk openjdk bot added the rfr Pull request is ready for review label May 28, 2024
@mlbridge
Copy link

mlbridge bot commented May 28, 2024

Webrevs

@tstuefe
Copy link
Member Author

tstuefe commented May 28, 2024

x86 problem unrelated

@tstuefe
Copy link
Member Author

tstuefe commented May 28, 2024

@jdksjolen could you take a look? You know the Arena coding behind it, and this PR is, in a very circumvent way, one of the prerequisites for NMT simplifications I plan.

Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

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

Today, the ChunkPools are allocated before main through static initialization. That means that the ChunkPools exists when main starts executing, so this is safe.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 29, 2024
@tstuefe
Copy link
Member Author

tstuefe commented May 31, 2024

Thanks @jdksjolen and @sspitsyn !

/integrate

@openjdk
Copy link

openjdk bot commented May 31, 2024

Going to push as commit ba323b5.
Since your change was applied there have been 80 commits pushed to the master branch:

  • 22ef827: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp
  • 2ab8ab5: 8332858: References with escapes have broken positions after they are transformed
  • 1b7d59f: 8333303: Issues with DottedVersion class
  • e304a8a: 8333307: Don't suppress jpackage logging in tests when it is detecting packaging tools in the system
  • 3634a91: 8332751: Broken link in VirtualMachine.html
  • ffb0867: 8331485: Odd Results when Parsing Scientific Notation with Large Exponent
  • 79f4998: 8321314: Reinstate disabling the compiler's default active annotation processing
  • ec88c6a: 8332917: failure_handler should execute gdb "info threads" command on linux
  • b3e29db: 8333108: Update vmTestbase/nsk/share/DebugeeProcess.java to don't use finalization
  • 11e926c: 8332777: Update JCStress test suite
  • ... and 70 more: https://git.openjdk.org/jdk/compare/08d51003d142e89b9d2f66187a4ea50e12b94fbb...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 31, 2024
@openjdk openjdk bot closed this May 31, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 31, 2024
@openjdk
Copy link

openjdk bot commented May 31, 2024

@tstuefe Pushed as commit ba323b5.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants