-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8300273: [IR framework] Handle <!-- safepoint while printing --> message instead of bailing out #12246
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
…age instead of bailing out
👋 Welcome back chagedorn! A progress list of the required criteria for merging this PR into |
@chhagedorn The following label will be automatically applied to this pull request:
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. |
Webrevs
|
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 is hard to review but the solution makes sense and the code looks good to me. Some of the files still have copyright year 2022.
@chhagedorn 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 53 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 |
Thank you Tobias for your review! I've updated the copyright years. |
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.
"Rubber stamp" ;^)
Thanks Vladimir for your review :-) I gave this another spin in the Valhalla repository and noticed that I accidentally dropped the XML escaping. I've re-added it. Will re-run some testing again. |
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.
Update is good.
Thanks Tobias and Vladimir for your reviews! Valhalla testing looked good with the update. /integrate |
Going to push as commit 59b7fb1.
Your commit was automatically rebased without conflicts. |
@chhagedorn Pushed as commit 59b7fb1. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is yet another attempt to fix the IR framework in cases where the
tty
lock is broken for a safepoint. This time, however, I've decided to not add another bailout but to just rewrite thehotspot_pid*
parsing code to completely parse everything. This means that<!-- safepoint while printing -->
messages are now skipped and then parsing continues for the reminder of aPrintIdeal
output block.When are
tty
locks broken?This can only happen when dumping
PrintIdeal
for various compile phases. ForPrintOptoAssembly
, we have aNoSafePointVerifier
object that ensures that we are not safepointing during the dump:jdk/src/hotspot/share/opto/output.cpp
Lines 1814 to 1822 in f7da09c
The last interesting message printed by
LogCompilation
that needs to be parsed is the compilation queued message. This message is emitted inCompileTask::log_task_queued()
where we also take thetty
lock. Since we do not seem to safepoint during this method, I've added aNoSafepointVerifier
object - just to be sure.Implementation details
The idea is that we keep track of writer thread ids and currently parsed
PrintIdeal
blocks when parsing thehotspot_pid*
file. If a new writer thread starts writing, it emits a<writer thread='1683670'/>
message with the id. If that happens while we are still parsing aPrintIdeal
block (i.e. not found the</ideal>
end tag for the<ideal ... />
opening tag), we store the currently parsed method (i.e. aLoggedMethod
object) with itsWriterThread
inWriterThread::saveLoggedMethod()
. When later parsing the same writer id again, we restore the method withWriterThread::restoreLoggedMethod()
and continue parsing.Each line of a
PrintIdeal
output block is stored within aCompilePhaseBlock
object. This class makes sure to remove any<!-- safepoint while printing -->
message (always at the end of a line with a line break) and to merge such a split line again.I've removed all previously added bailout fixes as they are not needed anymore with this fix.
I've added some more classes and did some renamings to better structure the parsing steps.
Testing
On top of normal tier testing, I've added a separate test that parses a manually written
hotspot_pid*
file that simulates various cases of breaking the tty log and emitting the<!-- safepoint while printing -->
message with a line break.Thanks,
Christian
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12246/head:pull/12246
$ git checkout pull/12246
Update a local copy of the PR:
$ git checkout pull/12246
$ git pull https://git.openjdk.org/jdk pull/12246/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12246
View PR using the GUI difftool:
$ git pr show -t 12246
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12246.diff