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

8290834: Improve potentially confusing documentation on collection of profiling information #9598

Closed
wants to merge 10 commits into from

Conversation

TheShermanTanker
Copy link
Contributor

@TheShermanTanker TheShermanTanker commented Jul 21, 2022

Documentation on the MethodData object incorrectly states that it is used when profiling in tiers 0 and 1, when it only does so for tier 0 (Interpreter) and tier 3, while tier 1 (Fully optimizing C1) does not collect any profile data at all. Additionally, the description for the different execution tiers is slightly confusing. This cleanup attempts to slightly better clarify how profiling is tied together between the Interpreter and C1, explain what MDO is an abbreviation for (MethodData object), and corrects the documentation for MethodData as well.


Progress

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

Issue

  • JDK-8290834: Improve potentially confusing documentation on collection of profiling information

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9598

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 21, 2022

👋 Welcome back jwaters! 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 openjdk bot changed the title 8290834 8290834: Improve potentially confusing documentation on collection of profiling information Jul 21, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 21, 2022
@openjdk
Copy link

openjdk bot commented Jul 21, 2022

@TheShermanTanker The following label will be automatically applied to this pull request:

  • hotspot

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

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jul 21, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 21, 2022

@dean-long
Copy link
Member

/label hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jul 22, 2022
@openjdk
Copy link

openjdk bot commented Jul 22, 2022

@dean-long
The hotspot-compiler label was successfully added.

@dean-long
Copy link
Member

C1 uses ciMethod::ensure_method_data(), which calls Method::build_interpreter_method_data(), to create an MDO if one wasn't already created by the interpreter. So the name build_interpreter_method_data() is a bit misleading, because C1 will use the same MDO as the interpreter.

I also found a comment in c1_globals.hpp about C1UpdateMethodData that mentions tier1. I think the comment should be changed to say tier3.

@openjdk
Copy link

openjdk bot commented Jul 22, 2022

⚠️ @TheShermanTanker This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@vnkozlov
Copy link
Contributor

Please note. CI (compiler interface) and its API (ciMethod*) is used by JIT compilers C1 and C2 only during compilation.
Compilers (C1 and C2) can create MDO (through CI) if it is missed but they don't update data in it.
Only Interpreter and tier 3 (profiling) compiled code produced by C1 updates MDO. It does it directly without CI.

@vnkozlov
Copy link
Contributor

@dean-long posted his comment before I finished my :)
But we are saying the same thing.

@TheShermanTanker
Copy link
Contributor Author

Please note. CI (compiler interface) and its API (ciMethod*) is used by JIT compilers C1 and C2 only during compilation. Compilers (C1 and C2) can create MDO (through CI) if it is missed but they don't update data in it. Only Interpreter and tier 3 (profiling) compiled code produced by C1 updates MDO. It does it directly without CI.

Ah, my mistake. I'll fix the issue asap

@mlbridge
Copy link

mlbridge bot commented Jul 24, 2022

Mailing list message from Kandu, Rahul on hotspot-compiler-dev:

-----Original Message-----
From: hotspot-compiler-dev <hotspot-compiler-dev-retn at openjdk.org> On Behalf Of Julian Waters
Sent: Saturday, July 23, 2022 7:00 AM
To: hotspot-dev at openjdk.org; hotspot-compiler-dev at openjdk.org
Subject: Re: RFR: 8290834: Improve potentially confusing documentation on collection of profiling information [v6]

On Fri, 22 Jul 2022 18:17:26 GMT, Dean Long <dlong at openjdk.org> wrote:

Julian Waters has updated the pull request incrementally with one additional commit since the last revision:

New changes

src/hotspot/share/compiler/compilationPolicy.hpp line 47:

45: * for the interpreter and ciMethod::ensure_method_data, ciMethod.cpp for C1), and interacts
46: * with C1 and C2 via the compiler interface. It is updated periodically as more profiling
47: * information is gathered, directly in the case of the interpreter and through ciMethodData

This is still a bit misleading. The information flow between MethodData and ciMethodData is one-way. Only MethodData are updated by the interpreter or generated code. ciMethodData is just a read-only snapshot used during compilation.

Revised

-------------

PR: https://git.openjdk.org/jdk/pull/9598

Copy link
Member

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

@TobiHartmann
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Jul 25, 2022

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

8290834: Improve potentially confusing documentation on collection of profiling information

Reviewed-by: thartmann, kvn, dlong

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

  • 7c3cfd1: 8290557: tools/jpackage/share/AddLauncherTest.java#id1 failed with "ERROR: Failed: Check icon file"
  • 0ca74f5: 8289659: Refactor I/O stream copying to use InputStream.readAllBytes in X509CertPath
  • 1e270ea: 8290780: AArch64: Crash in c2 nmethod running RunThese30M.java
  • b17269a: 8290959: Consistently use "grey" instead of "gray" in GC code
  • 350808a: 8290459: Remove unused GCCause enums
  • d0c365a: 8170794: [macosx] Error when using setDesktopManager on a JDesktopPane on MacOS X with Look and Feel Aqua
  • 80dc6ce: 8290730: compiler/vectorization/TestAutoVecIntMinMax.java failed with "IRViolationException: There were one or multiple IR rule failures."
  • 228e8e9: 8290700: Optimize AArch64 nmethod entry barriers
  • 852e71d: 8290870: NMT: Increase MallocSiteTable size and allocate it only when needed
  • 0599a05: 8290900: Build failure with Clang 14+ due to function warning attribute
  • ... and 7 more: https://git.openjdk.org/jdk/compare/7841e5cc387ba595f73f40b3a0d00d7e36df15ea...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.

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 (@TobiHartmann, @vnkozlov, @dean-long) 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 ready Pull request is ready to be integrated label Jul 25, 2022
@openjdk
Copy link

openjdk bot commented Jul 25, 2022

@TobiHartmann
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jul 25, 2022
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.

Good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 25, 2022
@TheShermanTanker
Copy link
Contributor Author

TheShermanTanker commented Jul 25, 2022

Thanks all for the reviews!

@TheShermanTanker
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 25, 2022
@openjdk
Copy link

openjdk bot commented Jul 25, 2022

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

@openjdk
Copy link

openjdk bot commented Jul 25, 2022

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

@dean-long
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 25, 2022

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

  • 7c3cfd1: 8290557: tools/jpackage/share/AddLauncherTest.java#id1 failed with "ERROR: Failed: Check icon file"
  • 0ca74f5: 8289659: Refactor I/O stream copying to use InputStream.readAllBytes in X509CertPath
  • 1e270ea: 8290780: AArch64: Crash in c2 nmethod running RunThese30M.java
  • b17269a: 8290959: Consistently use "grey" instead of "gray" in GC code
  • 350808a: 8290459: Remove unused GCCause enums
  • d0c365a: 8170794: [macosx] Error when using setDesktopManager on a JDesktopPane on MacOS X with Look and Feel Aqua
  • 80dc6ce: 8290730: compiler/vectorization/TestAutoVecIntMinMax.java failed with "IRViolationException: There were one or multiple IR rule failures."
  • 228e8e9: 8290700: Optimize AArch64 nmethod entry barriers
  • 852e71d: 8290870: NMT: Increase MallocSiteTable size and allocate it only when needed
  • 0599a05: 8290900: Build failure with Clang 14+ due to function warning attribute
  • ... and 7 more: https://git.openjdk.org/jdk/compare/7841e5cc387ba595f73f40b3a0d00d7e36df15ea...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 25, 2022
@openjdk openjdk bot closed this Jul 25, 2022
@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 Jul 25, 2022
@openjdk
Copy link

openjdk bot commented Jul 25, 2022

@dean-long @TheShermanTanker Pushed as commit 0ca5cb1.

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

@TheShermanTanker TheShermanTanker deleted the profile branch July 26, 2022 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
4 participants