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
8295867: TestVerifyGraphEdges.java fails with exit code -1073741571 when using AlwaysIncrementalInline #11065
Conversation
…hen using AlwaysIncrementalInline
|
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.
I agree that a non-recursive solution is preferable in this case. I only have some minor code style comments - otherwise, the fix looks good!
src/hotspot/share/opto/compile.cpp
Outdated
uint stack_size = live_nodes() >> 4; | ||
Node_List nstack(MAX2(stack_size, (uint)OptoNodeListSize)); |
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.
As you only need the stack in verify_edges()
, I suggest to move these lines directly into the method verify_edges()
.
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 need live_nodes()
value or stack_size
or C
to pass for creating list inside method.
I decided to move renamed verify_bidirectional_edges()
method to Compile
class to get these values inside the method.
It does not need to be in Node
class after I removed recursion.
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.
Right, I've missed that before. Moving it to Compile
is a good idea to apply that!
src/hotspot/share/opto/node.cpp
Outdated
// Walk over all input edges, checking for correspondence | ||
uint length = next->len(); | ||
for (uint i = 0; i < length; i++) { | ||
Node* n = next->in(i); |
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 suggest to rename n
to input
to make it easier to see if it is the current node or an input to it.
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.
Renamed to in
@vnkozlov This change now passes all automated pre-integration checks. 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 12 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.
|
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.
x86_32 seems to be happy with this change. I ran both TestVerifyGraphEdges
and tier1 tier2
with -XX:+VerifyGraphEdges
without problems with Linux x86_32 fastdebug. The code looks reasonable too.
Thank you, Aleksey and Christian. |
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.
Thanks for doing the updates, looks good!
/integrate |
Going to push as commit 819c691.
Your commit was automatically rebased without conflicts. |
When we use -Xcomp we compile
java.lang.invoke.LambdaForm$Kind::<clinit>
very long linear method for enum class: LambdaForm.java#L250In addition we inline all class initializers for EA when run with -Xcomp: bytecodeInfo.cpp#L410
Recent CDS change JDK-8293979 allows to inline a bit more deeply too.
Adding
-XX:+AlwaysIncrementalInline
worsened situation even more.Running with
-XX:+LogCompilation
shows that we hitNodeCountInliningCutoff (18000)
duringjava.lang.invoke.LambdaForm$Kind::<clinit>
compilation.In short, we have very long (>40000 live nodes) linear IR graph.
Node::verify_edges()
method process nodes depth-first starting from first input which is control edge. So it is not surprise that depth of this method recursion reached 6000.With frame size of 10 words (320 bytes) we easy hit stack overflow (768K in 32-bits debug VM).
I fixed it by using local buffer
Node_List
instead of recursion inNode::verify_edges()
.The algorithm was changed to simplify code. It processes inputs in reverse order - last input processed first. And I noticed that maximum use of buffer is only about 1000 or less elements for this compilation (that is why I use live_nodes/16 as initial size of buffer).
Then I did additional experiment with keeping recursion but processing inputs in reverse order:
And it shows the same around 1000 stack depth!
I decided to keep my original fix because it should be faster (put only one value on list instead of putting all locals, PC, SP on stack and calls) and much less stack usage.
Testing tier1-3, hs-comp-stress and
TestVerifyGraphEdges.java
test runs with-XX:+AlwaysIncrementalInline
.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11065/head:pull/11065
$ git checkout pull/11065
Update a local copy of the PR:
$ git checkout pull/11065
$ git pull https://git.openjdk.org/jdk pull/11065/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11065
View PR using the GUI difftool:
$ git pr show -t 11065
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11065.diff