Skip to content

8308745: ObjArrayKlass::allocate_objArray_klass may call into java while holding a lock#17660

Closed
coleenp wants to merge 2 commits intoopenjdk:masterfrom
coleenp:objArray2
Closed

8308745: ObjArrayKlass::allocate_objArray_klass may call into java while holding a lock#17660
coleenp wants to merge 2 commits intoopenjdk:masterfrom
coleenp:objArray2

Conversation

@coleenp
Copy link
Contributor

@coleenp coleenp commented Jan 31, 2024

This change uses a claim token to allocate multi dimensional arrays rather than holding MultiArray_lock around metaspace allocation. We can't hold a mutex around metaspace allocation because it can create an OOM object and it can also call into JVMTI for a resource exhausted event. Also, we were creating mirrors and more metadata arrays while holding this lock. See the bug for more details and other ideas considered and rejected.

Tested with tier1-7.


Progress

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

Issue

  • JDK-8308745: ObjArrayKlass::allocate_objArray_klass may call into java while holding a lock (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17660/head:pull/17660
$ git checkout pull/17660

Update a local copy of the PR:
$ git checkout pull/17660
$ git pull https://git.openjdk.org/jdk.git pull/17660/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17660

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17660.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 31, 2024

👋 Welcome back coleenp! 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 Jan 31, 2024
@openjdk
Copy link

openjdk bot commented Jan 31, 2024

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

  • hotspot
  • serviceability

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 serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Jan 31, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 31, 2024

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Can't you just use a Monitor to implement the claim token, rather than this lock-free approach? (Similar to how class initialization is handled.)

Sorry lost the forest in the trees.

@coleenp
Copy link
Contributor Author

coleenp commented Feb 6, 2024

I'm going to do a bit of rework as discussed with @dholmes-ora .

@coleenp coleenp closed this Feb 6, 2024
@coleenp coleenp deleted the objArray2 branch February 6, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants