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

8349539: [leyden] Allow dumping nmethods that reference archived hidden klasses #33

Closed
wants to merge 4 commits into from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Feb 6, 2025

Studying the bailout reasons for JavacBenchApp, I notices the majority of nmethod store bailouts are due to referencing the hidden klasses. Those checks seem to be from the initial commit. I wonder if we can actually skip hidden klass checks, now that we archive lots of those since invokedynamic AOT was implemented.


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8349539: [leyden] Allow dumping nmethods that reference archived hidden klasses (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 33

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/leyden/pull/33.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 6, 2025

👋 Welcome back shade! A progress list of the required criteria for merging this PR into premain 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 Feb 6, 2025

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

8349539: [leyden] Allow dumping nmethods that reference archived hidden klasses

Reviewed-by: vlivanov, kvn

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 3 new commits pushed to the premain branch:

  • 8125f60: 8349748: [leyden] ciEnv::register_method should lock the correct queue lock
  • cc546e2: 8349722: [leyden] Option to block until preloading is complete
  • 0a32077: 8349457: [leyden] Workaround Leyden problems with -XX:-TieredCompilation

Please see this link for an up-to-date comparison between the source branch of this pull request and the premain branch.
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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@iwanowww, @vnkozlov) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 6, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 6, 2025

Webrevs

@shipilev
Copy link
Member Author

shipilev commented Feb 6, 2025

Look at "user" time, this is what we save without recompiling the methods that get bailed from the archive.

$ rm -f *.cds*; hyperfine -w 3 -r 10 "build/linux-x86_64-server-release/images/jdk/bin/java -XX:CacheDataStore=JavacBenchApp.cds -cp JavacBenchApp.jar JavacBenchApp 500";

# Before
  Time (mean ± σ):      1.556 s ±  0.013 s    [User: 4.575 s, System: 0.501 s]
  Range (min … max):    1.538 s …  1.580 s    10 runs

# After
  Time (mean ± σ):      1.551 s ±  0.016 s    [User: 3.646 s, System: 0.458 s]
  Range (min … max):    1.536 s …  1.586 s    10 runs

Copy link
Collaborator

@iwanowww iwanowww left a comment

Choose a reason for hiding this comment

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

I agree that the restriction for hidden classes can be lifted.

But there are non-default modes where it still matters (UseMetadataPointers == true).
I suggest to keep klass->is_hidden() check, but move it down to guard symbolic resolution case.

@shipilev
Copy link
Member Author

But there are non-default modes where it still matters (UseMetadataPointers == true).

FWIW, I believe UseMetadataPointers is true by default. Turning it off starts to fail runtime/cds.

I suggest to keep klass->is_hidden() check, but move it down to guard symbolic resolution case.

Could you point me where exactly? I think there is a fair amount of symmetry against the hidden method checks here, so I moved the check to the same place:

if (method->is_hidden()) { // Skip such nmethod
set_lookup_failed();
return false;
}

@vnkozlov
Copy link
Collaborator

But there are non-default modes where it still matters (UseMetadataPointers == true).
FWIW, I believe UseMetadataPointers is true by default. Turning it off starts to fail runtime/cds.

I started implementation of Code caching using only symbolic resolution in relocations. When it is integrated with other changes I left such capability guarded by this flag.
We can retire this flag when the only way to use code caching is CDS archive which will contain the code instead of separate file. I am currently looking on this.

Copy link
Collaborator

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 10, 2025
@shipilev
Copy link
Member Author

Current GHA failures should be fixed by #35.

@shipilev
Copy link
Member Author

Are we good with this, @iwanowww? Is this the correct place to move the check?

Copy link
Collaborator

@iwanowww iwanowww left a comment

Choose a reason for hiding this comment

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

Looks good.

@shipilev
Copy link
Member Author

Thanks!

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Feb 11, 2025
@openjdk
Copy link

openjdk bot commented Feb 11, 2025

@shipilev
Your change (at version b4ec97a) is now ready to be sponsored by a Committer.

@vnkozlov
Copy link
Collaborator

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 11, 2025

Going to push as commit 242a98c.
Since your change was applied there have been 3 commits pushed to the premain branch:

  • 8125f60: 8349748: [leyden] ciEnv::register_method should lock the correct queue lock
  • cc546e2: 8349722: [leyden] Option to block until preloading is complete
  • 0a32077: 8349457: [leyden] Workaround Leyden problems with -XX:-TieredCompilation

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 11, 2025
@openjdk openjdk bot closed this Feb 11, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Feb 11, 2025
@openjdk
Copy link

openjdk bot commented Feb 11, 2025

@vnkozlov @shipilev Pushed as commit 242a98c.

💡 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
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants