-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8332111: [BACKOUT] A way to align already compiled methods with compiler directives #19215
Conversation
👋 Welcome back eastigeevich! A progress list of the required criteria for merging this PR into |
/cc hotspot-compiler |
@eastig 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 7 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 |
@eastig |
/label hotspot |
@eastig |
/label serviceability |
@eastig |
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.
The reversal looks fine.
Are there any high severity problems caused by the original PR? Especially not in the new functionality. Minor issues could be probably addressed without backing out the entire functionality. |
Yes, there are:
|
So there are cases when new functionality doesn't work as expected (I don't see any other users impacted). Why not file bugs for those cases and estimate their impact? |
Do you know any users using the new functionality? |
IMO if nobody uses it and the amount of code is small, it is better to back out it and to reimplement it. |
@eastig do you have tests which shows issues you listed in description? I don't see any reference to them in this sub-task and in [REDO] bug JDK-8331749. |
Here is a jtreg test:
|
There is no
I think using them we can also simulate, though it would not be easy to write a test:
|
I've been backporting JDK-8309271 to downstream 17 and 21. As compilations happens in background but a test from JDK-8309271 runs with background compilation off, I asked myself what might happen with background compilation. I have a patch fixing the test above. I don't think it is a complete fix. There is a race among a thread updating directives, compiler threads and CodeCache cleaning threads. We don't properly lock the directives stack, the compile queue and CodeCache to manage the race. |
What if instead of backing out we will use an experimental JVM flag: |
This is indeed concerning. |
I don't think this is correct way to fix the bug. |
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.
I agree with this backout. Thank you @eastig for explaining your point.
We have about 3 weeks before RDP1 and it is better we have less issues before that.
Let redo implementation in next release taking into account the issues you found and have more time for testing.
OK. I hope it takes less time to get back into the source tree than it did initially. |
/integrate |
Going to push as commit 1a94447.
Your commit was automatically rebased without conflicts. |
Backout of JDK-8309271 which has known bugs, possible bugs and performance issues. REDO work is tracked by JDK-8331749.
Found bugs:
CompilerDirectivesAddDCmd::execute
will callDirectivesStack::hasMatchingDirectives(mh, true)
which only considers the compiler directive which is on the top of the directives stack. As more than one directive can be added,CompilerDirectivesAddDCmd::execute
will not behave as expected.There are other concerns: bugs and performance issues.
Possible bugs:
has_matching_directives
might not be cleared. A nmethod might get into the unloading state beforeCodeCache::recompile_marked_directives_matches
. If the nmethod has been used to mark a Java method and it is the only nmethod, there will be no nmethod in CodeCache to reach the Java method to clear the mark.CodeCache::recompile_marked_directives_matches
.CodeCache::recompile_marked_directives_matches
will recompile it again.Performance issues:
CodeCache::recompile_marked_directives_matches
will be traversing nmethods most of which don't need recompilation.The backout is not clean because of removal of
CompiledMethod
.Tested with release and fastdebug builds: tier1 and tier2 passed.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19215/head:pull/19215
$ git checkout pull/19215
Update a local copy of the PR:
$ git checkout pull/19215
$ git pull https://git.openjdk.org/jdk.git pull/19215/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19215
View PR using the GUI difftool:
$ git pr show -t 19215
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19215.diff
Webrev
Link to Webrev Comment