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

8252543: [JVMCI] Libgraal can deadlock in blocking compilation mode #35

Closed
wants to merge 1 commit into from

Conversation

dougxc
Copy link
Member

@dougxc dougxc commented Sep 6, 2020

To prevent a deadlock in libgraal under -Xcomp or -Xbatch due to a lock being held in libgraal, a new mechanism is added by this change that allow JVMCI compiler threads to communicate their "progress" to HotSpot:

  • Each JVMCI compiler thread has a "compilation ticks" counter.
  • There is also a global JVMCI compilation ticks counter.
  • Each JVMCI VM call increments the JVMCI compiler thread-local compilation ticks counter.
  • Every 512 increments of such a counter also increments the global counter.
  • A thread waiting on a blocking JVMCI compilation will be unblocked if these counters indicate no progress after a defined period.

Progress

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

Issue

  • JDK-8252543: [JVMCI] Libgraal can deadlock in blocking compilation mode

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/35/head:pull/35
$ git checkout pull/35

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 6, 2020

👋 Welcome back dnsimon! 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 Sep 6, 2020
@openjdk
Copy link

openjdk bot commented Sep 6, 2020

@dougxc 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 (add|remove) "label" command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Sep 6, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 6, 2020

Webrevs

@vnkozlov
Copy link
Contributor

/reviewer add vnkozlov

@openjdk
Copy link

openjdk bot commented Sep 11, 2020

@vnkozlov Only the author (@dougxc) is allowed to issue the reviewer command.

@vnkozlov
Copy link
Contributor

Looks good.

@openjdk
Copy link

openjdk bot commented Sep 12, 2020

@dougxc This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements

After integration, the commit message will be:

8252543: [JVMCI] Libgraal can deadlock in blocking compilation mode

Reviewed-by: kvn
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 35 commits pushed to the master branch:

  • b1b0f0b: 8253066: typo in Stream.mapMulti
  • 306b166: 8253033: CheckUnhandledOops check fails in ThreadSnapshot::initialize…
  • 5c0d985: 8253060: remove test/hotspot/jtreg/test_env.sh
  • 9525186: 8253031: git jcheck complains about invalid tags in jdk repo after fix for JDK-8252844
  • 7f27d0b: 8236142: DocTrees should provide getCharacters(EntityTree)
  • e7a1b9b: 8252981: ObjectMonitor::object() cleanup changes extracted from JDK-8247281
  • 040c8f5: 8250914: Matcher::stack_direction() is unused
  • 9687dca: 8252494: C2: TypeAryPtr::cast_to_autobox_cache does not use ptr_type
  • 8777ded: 8253008: Remove develop flags TraceLongCompiles/LongCompileThreshold
  • c7062dc: 8253026: Remove dummy call to gc alot from VM Thread
  • ... and 25 more: https://git.openjdk.java.net/jdk/compare/e20004d7c170dc9f25f23c0a5dbf3a4c67db9423...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate b1b0f0b2ccfa199b00a4e2398f4a228a9f467e98.

➡️ 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 Sep 12, 2020
@dougxc
Copy link
Member Author

dougxc commented Sep 12, 2020

/integrate

@openjdk openjdk bot closed this Sep 12, 2020
@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 Sep 12, 2020
@openjdk
Copy link

openjdk bot commented Sep 12, 2020

@dougxc Since your change was applied there have been 35 commits pushed to the master branch:

  • b1b0f0b: 8253066: typo in Stream.mapMulti
  • 306b166: 8253033: CheckUnhandledOops check fails in ThreadSnapshot::initialize…
  • 5c0d985: 8253060: remove test/hotspot/jtreg/test_env.sh
  • 9525186: 8253031: git jcheck complains about invalid tags in jdk repo after fix for JDK-8252844
  • 7f27d0b: 8236142: DocTrees should provide getCharacters(EntityTree)
  • e7a1b9b: 8252981: ObjectMonitor::object() cleanup changes extracted from JDK-8247281
  • 040c8f5: 8250914: Matcher::stack_direction() is unused
  • 9687dca: 8252494: C2: TypeAryPtr::cast_to_autobox_cache does not use ptr_type
  • 8777ded: 8253008: Remove develop flags TraceLongCompiles/LongCompileThreshold
  • c7062dc: 8253026: Remove dummy call to gc alot from VM Thread
  • ... and 25 more: https://git.openjdk.java.net/jdk/compare/e20004d7c170dc9f25f23c0a5dbf3a4c67db9423...master

Your commit was automatically rebased without conflicts.

Pushed as commit 998ce78.

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

@dougxc dougxc deleted the JDK-8252543 branch October 20, 2020 08:46
openjdk-notifier bot pushed a commit that referenced this pull request Apr 7, 2022
asotona pushed a commit to asotona/jdk that referenced this pull request Oct 7, 2022
* Add List combining methods to ClassEntry

jdk.classfile.ClassEntry and java.lang.constant.ClassDesc are two ways
of describing similar data. Often when working with Attributes, we need to
create lists that combine ClassEntrys and ClassDescs into a single list

This PR adds support working with such lists by adding 4 static methods
to ClassEntry:
* List<CE> adding(List<CE> base, List<CE> additions)
* List<CE> adding(List<CE> base, CE... additions)
* List<CE> addingSymbols(List<CE> base, List<CD> additions)
* List<CE> addingSymbols(List<CE> base, CD...additions)

This methods convert from CD to CE to create a combined List<CE>.
The methods are null-hostile in the "additions" but do not check for
nulls in the "base" List.

The returned List is mutable so these methods can be common building
blocks for composing with other CE entries.

A test has been added that validates the existing behaviours.

* Return immutable lists rather than mutable ones.

A side-effect of this change is that the `base` List is now null-hostile
as well as the List.copyOf on the comination is null-hostile.

* Implement `List<CE> deduplicate(List<CE>)`

This allows users to add to a list without worrying about the existing
contents and in cases where they wish to apply a "no duplicates" invariant,
they can deduplicate the List

* Implement missing ConcreteEntry equals() methods

* Basic deduplicate() test
asotona pushed a commit to asotona/jdk that referenced this pull request Feb 6, 2023
* Add List combining methods to ClassEntry

jdk.classfile.ClassEntry and java.lang.constant.ClassDesc are two ways
of describing similar data. Often when working with Attributes, we need to
create lists that combine ClassEntrys and ClassDescs into a single list

This PR adds support working with such lists by adding 4 static methods
to ClassEntry:
* List<CE> adding(List<CE> base, List<CE> additions)
* List<CE> adding(List<CE> base, CE... additions)
* List<CE> addingSymbols(List<CE> base, List<CD> additions)
* List<CE> addingSymbols(List<CE> base, CD...additions)

This methods convert from CD to CE to create a combined List<CE>.
The methods are null-hostile in the "additions" but do not check for
nulls in the "base" List.

The returned List is mutable so these methods can be common building
blocks for composing with other CE entries.

A test has been added that validates the existing behaviours.

* Return immutable lists rather than mutable ones.

A side-effect of this change is that the `base` List is now null-hostile
as well as the List.copyOf on the comination is null-hostile.

* Implement `List<CE> deduplicate(List<CE>)`

This allows users to add to a list without worrying about the existing
contents and in cases where they wish to apply a "no duplicates" invariant,
they can deduplicate the List

* Implement missing ConcreteEntry equals() methods

* Basic deduplicate() test
robehn pushed a commit to robehn/jdk that referenced this pull request Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
2 participants