Skip to content
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

8285820: C2: LCM prioritizes locally dependent CreateEx nodes over projections after 8270090 #8568

Closed
wants to merge 1 commit into from

Conversation

robcasloz
Copy link
Contributor

@robcasloz robcasloz commented May 6, 2022

This changeset lowers the priority of locally-dependent CreateEx nodes, that is CreateEx nodes that are not initially ready for scheduling in LCM. The proposed scheme assigns them the same priority as projection nodes when selecting the next node to be scheduled, restoring the relative prioritization between projections and CreateEx nodes to the state it was before JDK-8270090. JDK-8270090 wrongly gave all CreateEx nodes the highest priority, which leads to failures whenever projection nodes are expected to get higher priority than locally-dependent CreateEx nodes. See the JBS issue report for further detail.

More specifically, the current ranking to select the next node to be scheduled in PhaseCFG::select() is:

  1. CreateEx nodes (initially ready or not)
  2. Projections
  3. Constants and CheckCastPP nodes (tie)
  4. ...

After this changeset, the ranking becomes:

  1. Initially ready CreateEx nodes
  2. Projections and other CreateEx nodes (tie)
  3. Constants and CheckCastPP nodes (tie)
  4. ...

which still addresses the issue handled by JDK-8270090 but in a form that is closer to the original ranking before JDK-8270090:

  1. Initially ready CreateEx nodes
  2. Projections, other CreateEx nodes, constants and CheckCastPP nodes (tie)
  3. ...

This changeset implements the minimal changes to restore the relative prioritization between CreateEx nodes and projections to the state it was before JDK-8270090, for risk minimization and ease of backporting. I will file a separate RFE proposing a more robust alternative than altering the order of the LCM worklist for ensuring that initially ready CreateEx nodes are scheduled at the block start.

Testing

Functionality
  • Original failure on x86_32 using -XX:+UseShenandoahGC (thanks to Aleksey Shipilev for testing).
  • Original failure of JDK-8270090 on arm32 (thanks to Marc Hoffmann for testing).
  • hs-tier1-5 (windows-x64, linux-x64, linux-aarch64, and macosx-x64; release and debug mode).
  • hs-tier1-3 (windows-x64, linux-x64, linux-aarch64, and macosx-x64; debug mode) with StressLCM and StressGCM (5 different seeds).
Performance

Tested performance on a set of standard benchmark suites (DaCapo, SPECjbb2015, SPECjvm2008, ...) and on linux-x64, linux-aarch64, windows-x64, and macosx-x64. No significant regression was observed.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 reviewer)

Issue

  • JDK-8285820: C2: LCM prioritizes locally dependent CreateEx nodes over projections after 8270090

Reviewers

Contributors

  • Aleksey Shipilev <shade@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8568/head:pull/8568
$ git checkout pull/8568

Update a local copy of the PR:
$ git checkout pull/8568
$ git pull https://git.openjdk.java.net/jdk pull/8568/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8568

View PR using the GUI difftool:
$ git pr show -t 8568

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8568.diff

@bridgekeeper
Copy link

bridgekeeper bot commented May 6, 2022

👋 Welcome back rcastanedalo! 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.

@robcasloz robcasloz changed the title C2: LCM prioritizes locally dependent CreateEx nodes over projections after 8270090 8285820: C2: LCM prioritizes locally dependent CreateEx nodes over projections after 8270090 May 6, 2022
@openjdk
Copy link

openjdk bot commented May 6, 2022

@robcasloz The following label will be automatically applied to this pull request:

  • hotspot-compiler

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.

@openjdk openjdk bot added the hotspot-compiler label May 6, 2022
Copy link
Contributor

@shipilev shipilev left a comment

This seems to pass x86_32 tier{1,2,3} with Shenandoah.

@robcasloz robcasloz marked this pull request as ready for review May 10, 2022
@robcasloz
Copy link
Contributor Author

robcasloz commented May 10, 2022

This seems to pass x86_32 tier{1,2,3} with Shenandoah.

Thanks for testing, Aleksey!

@openjdk openjdk bot added the rfr label May 10, 2022
@mlbridge
Copy link

mlbridge bot commented May 10, 2022

Webrevs

@robcasloz
Copy link
Contributor Author

robcasloz commented May 10, 2022

/contributor add @shipilev

@openjdk
Copy link

openjdk bot commented May 10, 2022

@robcasloz
Contributor Aleksey Shipilev <shade@openjdk.org> successfully added.

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Looks reasonable to me.

@openjdk
Copy link

openjdk bot commented May 10, 2022

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

8285820: C2: LCM prioritizes locally dependent CreateEx nodes over projections after 8270090

Co-authored-by: Aleksey Shipilev <shade@openjdk.org>
Reviewed-by: thartmann, kvn

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 103 new commits pushed to the master branch:

  • ecbb380: 8286303: Serial: Remove reference to ParGCRareEvent_lock
  • 9835678: 8285710: Miscalculation of G1CardSetAllocator unused memory size
  • 1ca5404: 8286125: C2: "bad AD file" with PopulateIndex on x86_64
  • 9e320d9: 8286198: [linux] Fix process-memory information
  • 65f5067: 8286429: jpackageapplauncher build fails intermittently in Tier[45]
  • c4bd449: 8238373: Punctuation should be same in jlink help usage on Japanese language
  • 3fa1c40: 8286298: Remove unused methods in sun.invoke.util.VerifyType
  • 3462190: 8286163: micro-optimize Instant.plusSeconds
  • 60a91d1: 8286285: G1: Rank issues with ParGCRareEvent_lock and Threads_lock
  • d478958: 8286179: Node::find(int) should not traverse from new to old nodes
  • ... and 93 more: https://git.openjdk.java.net/jdk/compare/4434c7df036a2b2ffff54b8b19943de3c23a4e52...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label May 10, 2022
@robcasloz
Copy link
Contributor Author

robcasloz commented May 10, 2022

Looks reasonable to me.

Thanks for reviewing, Tobias!

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Looks good.

@robcasloz
Copy link
Contributor Author

robcasloz commented May 10, 2022

Looks good.

Thanks for the review, Vladimir!

@robcasloz
Copy link
Contributor Author

robcasloz commented May 12, 2022

/integrate

@openjdk
Copy link

openjdk bot commented May 12, 2022

Going to push as commit 89392fb.
Since your change was applied there have been 142 commits pushed to the master branch:

  • 96d48f3: 8286433: Cache certificates decoded from TLS session tickets
  • 7567627: 8286467: G1: Collection set pruning adds one region too many
  • 82d2570: 8283001: windows-x86-cmp-baseline fails in some jvmti native libs
  • e9f45bb: 8282966: AArch64: Optimize VectorMask.toLong with SVE2
  • 57a7670: 8285612: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java
  • 44a60ce: 8285867: Convert applet manual tests SelectionVisible.java to Frame and automate
  • ccbe8fa: 8282772: JButton text set as HTML content has unwanted padding
  • 1586bf8: 8286401: Address possibly lossy conversions in Microbenchmarks
  • 1c50ea3: 8282607: runtime/ErrorHandling/MachCodeFramesInErrorFile.java failed with "RuntimeException: 0 < 2"
  • fcf49f4: 8286441: Remove mode parameter from jdk.internal.perf.Perf.attach()
  • ... and 132 more: https://git.openjdk.java.net/jdk/compare/4434c7df036a2b2ffff54b8b19943de3c23a4e52...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label May 12, 2022
@openjdk openjdk bot closed this May 12, 2022
@openjdk openjdk bot removed ready rfr labels May 12, 2022
@openjdk
Copy link

openjdk bot commented May 12, 2022

@robcasloz Pushed as commit 89392fb.

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

@robcasloz
Copy link
Contributor Author

robcasloz commented May 12, 2022

I will file a separate RFE proposing a more robust alternative than altering the order of the LCM worklist for ensuring that initially ready CreateEx nodes are scheduled at the block start.

Here is the RFE: https://bugs.openjdk.java.net/browse/JDK-8286622.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler integrated
4 participants