Skip to content

8355003: Implement Ahead-of-Time Method Profiling #24886

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

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

veresov
Copy link
Contributor

@veresov veresov commented Apr 25, 2025

Improve warm-up time by making profile data from a previous run of an application instantly available, when the HotSpot Java Virtual Machine starts. Specifically, enhance the AOT cache to store method execution profiles from training runs, reducing profiling delays in subsequent production runs.

More details in the JEP: https://bugs.openjdk.org/browse/JDK-8325147


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-8355003: Implement Ahead-of-Time Method Profiling (Sub-task - P4)

Reviewers

Contributors

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24886

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 25, 2025

👋 Welcome back iveresov! 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 Apr 25, 2025

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

8355003: Implement Ahead-of-Time Method Profiling

Co-authored-by: John R Rose <[email protected]>
Co-authored-by: Vladimir Ivanov <[email protected]>
Co-authored-by: Ioi Lam <[email protected]>
Co-authored-by: Vladimir Kozlov <[email protected]>
Co-authored-by: Aleksey Shipilev <[email protected]>
Reviewed-by: ihse

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 11 new commits pushed to the master 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.

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

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov
The hotspot-compiler label was successfully added.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov
The hotspot-runtime label was successfully added.

@veresov
Copy link
Contributor Author

veresov commented Apr 25, 2025

/contributor jrose
/contributor vlivanov
/contributor iklam
/contributor kvn
/contributor shade

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <[email protected]>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <[email protected]>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <[email protected]>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <[email protected]>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <[email protected]>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@veresov
Copy link
Contributor Author

veresov commented Apr 25, 2025

/contributor add jrose
/contributor add vlivanov
/contributor add iklam
/contributor add kvn
/contributor add shade

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov
Contributor John R Rose <[email protected]> successfully added.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov
Contributor Vladimir Ivanov <[email protected]> successfully added.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov
Contributor Ioi Lam <[email protected]> successfully added.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov
Contributor Vladimir Kozlov <[email protected]> successfully added.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@veresov
Contributor Aleksey Shipilev <[email protected]> successfully added.

@mlbridge
Copy link

mlbridge bot commented Apr 25, 2025

Webrevs

Copy link
Contributor

@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.

In general it is okay.

Please, use UL with (aot, training) tags for your code.

I noticed (and added comment) that you use guarantee() which crashes VM when you call new verify methods. Can you disable TD instead and continue execution?

@@ -1725,8 +1793,26 @@ bool MethodData::profile_parameters_for_method(const methodHandle& m) {
}

void MethodData::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(MethodData): %p", this);
log_trace(cds)("Iter(MethodData): %p for %p %s", this, _method, _method->name_and_sig_as_C_string());
Copy link
Contributor

Choose a reason for hiding this comment

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

We discussed yesterday and we need to use aot instead cds for Leyden. aot tag is already in mainline.
I suggest to use new tag (aot, training) to separate your output from general CDS/AOT output.

@@ -739,6 +767,10 @@ void ArchiveBuilder::relocate_metaspaceobj_embedded_pointers() {
log_info(cds)("Relocating embedded pointers in core regions ... ");
relocate_embedded_pointers(&_rw_src_objs);
relocate_embedded_pointers(&_ro_src_objs);
log_info(cds)("Relocating %zu pointers, %zu tagged, %zu nulled",
Copy link
Contributor

Choose a reason for hiding this comment

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

log_info(aot) if it is Leyden related.

bool is_excluded = !holder()->is_loaded() || SystemDictionaryShared::check_for_exclusion(holder(), nullptr);
if (is_excluded) {
ResourceMark rm;
log_debug(cds)("Cleanup KTD %s", name()->as_klass_external_name());
Copy link
Contributor

Choose a reason for hiding this comment

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

log_debug(aot, training)

@openjdk
Copy link

openjdk bot commented Apr 28, 2025

@veresov this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout pp2
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Apr 28, 2025
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Apr 28, 2025
@erikj79
Copy link
Member

erikj79 commented Apr 28, 2025

Build changes look trivially good.

Copy link
Contributor

@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 better.
There are still places where UL is used specifically for TD processing. Consider using (aot, training) there instead of (cds).

@veresov
Copy link
Contributor Author

veresov commented Apr 28, 2025

Looks better. There are still places where UL is used specifically for TD processing. Consider using (aot, training) there instead of (cds).

Right. I haven't addressed these review comments yet.

Copy link
Member

@magicus magicus left a comment

Choose a reason for hiding this comment

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

Build changes are trivially fine.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants