Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8258393: Shenandoah: "graph should be schedulable" assert failure #41

Closed
wants to merge 2 commits into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Dec 17, 2020

This is a shenandoah bug but the fix is in shared code.

At barrier expansion time, we need the raw memory state for the
control at which the barrier is expanded. Before expansion, the memory
graph is traversed and memory state for each control is recorded. In
that process, if opportunities to improve the memory graph are found,
the graph is modified. In the case of the failure, a raw memory load
was assigned a call projection as control but for that control, no
memory state was recorded and the fall back is to use the call's input
memory state. As a consequence the load's memory input is updated to a
wrong memory state. This causes the assert failure.

The call has 2 memory projections: one for the fallthrough and one for
the exception path. One projection is the memory state for the
CatchProj for the fallthrough, the other one for the CatchProj of the
exception path. For the control projection out of the call, there's no
memory state that makes sense and assigning the control projection of
the call as control for the load is the root cause of the
problem. This happens because anti-dependence analysis is too
conservative: a memory Phi that merges states from the exception and
fallthrough path is considered a dependency and that pushed the load
right after the call.

I propose to be less conservative in anti-dependence analysis for
Phis. For a Phi, when computing the LCA, I think it's sufficient to
only consider region's inputs that we actually reach by following the
memory edges and that's what I propose here.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8258393: Shenandoah: "graph should be schedulable" assert failure

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/41/head:pull/41
$ git checkout pull/41

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 17, 2020

👋 Welcome back roland! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 17, 2020
@openjdk
Copy link

openjdk bot commented Dec 17, 2020

@rwestrel The following labels will be automatically applied to this pull request:

  • hotspot
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot shenandoah shenandoah-dev@openjdk.java.net labels Dec 17, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 17, 2020

Webrevs

@rwestrel
Copy link
Contributor Author

/label add hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.java.net label Dec 17, 2020
@openjdk
Copy link

openjdk bot commented Dec 17, 2020

@rwestrel
The hotspot-compiler label was successfully added.

@rwestrel
Copy link
Contributor Author

/label remove hotspot

@openjdk openjdk bot removed the hotspot label Dec 17, 2020
@openjdk
Copy link

openjdk bot commented Dec 17, 2020

@rwestrel
The hotspot label was successfully removed.

Copy link
Contributor

@rkennke rkennke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, the change looks good. I'm not very familiar with the code, it would be good to have somebody else check it too.
I verified that the tests that failed before are passing now and also have run some additional tests.

@openjdk
Copy link

openjdk bot commented Dec 21, 2020

@rwestrel 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:

8258393: Shenandoah: "graph should be schedulable" assert failure

Reviewed-by: rkennke, thartmann

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 21, 2020
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks reasonable to me.


/**
* @test
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing @requires vm.gc.Shenandoah

@@ -0,0 +1,70 @@
/*
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright should be updated to 2021.

assert(!ctrl->is_Call() || ctrl == n, "projection expected");
#ifdef ASSERT
if ((ctrl->is_Proj() && ctrl->in(0)->is_Call()) ||
(ctrl->is_Catch() && ctrl->in(0)->in(0)->is_Call())){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong and whitespace is missing here ))){

for (uint j = 1; j < s->req(); j++) {
Node* in = s->in(j);
Node* r_in = r->in(j);
if (worklist.member(in) && is_dominator(early, r_in)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above we check for !sctrl->is_top(), do we need the same check for r_in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a Region can have a top input at this point (previous IGVN should have taken care of it).

@rwestrel
Copy link
Contributor Author

rwestrel commented Jan 5, 2021

Otherwise looks reasonable to me.

Thanks for the review. I took care of your comments (except for the is_top() check that I don't think is needed).

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating, looks good to me.

@rwestrel
Copy link
Contributor Author

rwestrel commented Jan 5, 2021

As far as I can tell, the change looks good. I'm not very familiar with the code, it would be good to have somebody else check it too.
I verified that the tests that failed before are passing now and also have run some additional tests.

thanks for the review and running tests.

@rwestrel
Copy link
Contributor Author

rwestrel commented Jan 5, 2021

/integrate

@openjdk openjdk bot closed this Jan 5, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 5, 2021
@openjdk
Copy link

openjdk bot commented Jan 5, 2021

@rwestrel Pushed as commit 6775113.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.java.net integrated Pull request has been integrated shenandoah shenandoah-dev@openjdk.java.net
3 participants