8300002: Performance regression caused by non-inlined hot methods due to post call noop instructions#11958
8300002: Performance regression caused by non-inlined hot methods due to post call noop instructions#11958kuksenko wants to merge 8 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back skuksenko! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Please add a summary to the PR description.
If you update the last usage in ciMethod::has_compiled_code(), it looks like ciMethod::instructions_size is not needed anymore and can be removed. Instead, you could just change its semantic to exclude nops (please also update the method's comments).
|
Hi Sergey, Would you mind some RV part taking a ride? Thank you! (no need to add a contributor for this) By the way, seems GHA says Thanks, |
iwanowww
left a comment
There was a problem hiding this comment.
As an alternative way to count nops, have you considered iterating over relocations and counting post_call_nop_Reolcations then multiplying the count by NativePostCallNop::instruction_size? (So far, there's no NativePostCallNop::instruction_size declared on aarch64 and ppc, but that's the common pattern in nativeInst_*.hpp.)
BTW I'm curious why there's no relocation registered on PPC while both x86 and aarch64 have it.
|
Xiaolin, |
I thought about it. |
It was my first draft which I didn't show here. |
I don't know the answer. |
I agree with you. In fact I think we might want to do this route for generational ZGC as well. We don't want our different barriers to cause different inlining decisions. But if we go down that route, perhaps the name of the exclusion tool should be more generic? |
I was surprised to find out about other usages so fast. I will do renaming. |
vnkozlov
left a comment
There was a problem hiding this comment.
I don't see _instructions_size is used anymore so I suggest simply remove it and use _inline_instructions_size. Which was original purpose of this value anyway.
You missed ciReplay change to record _inline_instructions_size and restore it. That is what is used in inlining decision in your changes.
Also you need to record it in vmStructs.cpp. Just rename it.
I think this is just a matter of how we define "instruction size". We could simply define it as not including oops. I would prefer to rename the existing usages to I see that Vladimir suggested the same. @vnkozlov, regarding
We currently don't record/restore jdk/src/hotspot/share/ci/ciReplay.cpp Lines 1531 to 1532 in 9f24a6f But I agree that it's better to be consistent here. |
|
@kuksenko 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 81 new commits pushed to the
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 |
|
/integrate |
|
Going to push as commit 89a032d.
Your commit was automatically rebased without conflicts. |
Post call nop instructions increase the size of methods, which leads to different inline decisions and performance regression.
Restore inline behavior by excluding post call nop instructions sizes from inline heuristics.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11958/head:pull/11958$ git checkout pull/11958Update a local copy of the PR:
$ git checkout pull/11958$ git pull https://git.openjdk.org/jdk pull/11958/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11958View PR using the GUI difftool:
$ git pr show -t 11958Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11958.diff