-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8350086: Inline hot Method accessors for faster task selection #23634
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
Conversation
|
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
|
@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: 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 10 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
vnkozlov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
coleenp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine but at one point we were talking about moving what looks like the duplicated InvocationCounters from MethodCounters and use MDO instead. I think this looks like it could be something to clean up.
theRealAph
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's nice. It looks to me like those methods would only be a few instructions long, so the overhead of a subroutine would be disproportionate, and the cost of inlining small. Win-win.
|
The patch looks well-justified to me, but it feels like the focus is on a symptom and not the root cause.
That's the consequence of poor scaling properties FTR heavy lock contention on |
There's definitely some duplication between MethodCounter and MDO, but those two serve different purposes at runtime when it comes to profiling (facilitate different profiling modes). There are ways to merge them, but it may have far-reaching consequences for the implementation (e.g., fast MDO presence check is used to guard profiling logic in interpreter). Not clear to me whether it'll worth the effort. |
|
Thank you for reviews! Yes, the core of the problem is potentially quadratic behavior in task selection, like Vladimir describes. We had this problem in Leyden for SCC tasks: openjdk/leyden#17 -- so it does not apply to SC loaded methods anymore. I agree it would be great to resolve the task selection problem at its core; unfortunately, my crude attempts at doing so failed, because tiered policy is quite fiddly. It does not mean we would not try again, it just means it would take a bit more time. Meanwhile, we can address little inefficiencies without solving the core issue. To that extent, I would spin this more positively: now that Leyden is able to shift away the bulk of C2 compilations away, the little inefficiencies in normal compilation paths show up in those runs. The inefficiency is also in mainline, but it would be obscured by the heavy compilations that would follow the task selection. So I think these kind of inlining improvements stand well on their own, and are still worth doing. |
|
/integrate |
|
Going to push as commit b1b4828.
Your commit was automatically rebased without conflicts. |
These methods show up prominently on Leyden profiles, as compilation policy asks these properties for methods very often during compile task selection:
Method::invocation_countMethod::backedge_countMethod::highest_comp_levelWe can move the definitions for these methods to method.inline.hpp to make them eligible for better inlining.
interpreter_invocation_count()method is a bit weird, looks like a leftover from JDK-8251462. Removing it would prompt more cleanups and renamings inciMethod, so I would leave it for future enhancement.Additional testing:
CompilerBrokermethodsProgress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23634/head:pull/23634$ git checkout pull/23634Update a local copy of the PR:
$ git checkout pull/23634$ git pull https://git.openjdk.org/jdk.git pull/23634/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23634View PR using the GUI difftool:
$ git pr show -t 23634Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23634.diff
Using Webrev
Link to Webrev Comment