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

8294538: missing is_unloading() check in SharedRuntime::fixup_callers_callsite() #10747

Closed
wants to merge 1 commit into from

Conversation

dean-long
Copy link
Member

@dean-long dean-long commented Oct 18, 2022

This change adds a missing is_unloading() check for the callee in SharedRuntime::fixup_callers_callsite() and removes from_compiled_entry_no_trampoline() because it is no longer used.


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-8294538: missing is_unloading() check in SharedRuntime::fixup_callers_callsite()

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10747

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

Using diff file

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

@dean-long dean-long marked this pull request as ready for review October 18, 2022 17:37
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 18, 2022

👋 Welcome back dlong! 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 Oct 18, 2022
@openjdk
Copy link

openjdk bot commented Oct 18, 2022

@dean-long The following label will be automatically applied to this pull request:

  • hotspot

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 hotspot-dev@openjdk.org label Oct 18, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 18, 2022

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Seems fine.

@openjdk
Copy link

openjdk bot commented Oct 18, 2022

@dean-long 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:

8294538: missing is_unloading() check in SharedRuntime::fixup_callers_callsite()

Reviewed-by: kvn, thartmann, eosterlund

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

  • f5dabf9: 8295088: Update External Spec page to show tabs for hosts
  • 2181042: 8295375: debug agent class tracking should not piggy back on the cbClassPrepare() callback
  • f41711e: 8295650: JFR: jfr scrub should warn if an event type doesn't exist
  • 0c13d66: 8295530: Update Zlib Data Compression Library to Version 1.2.13
  • 15bebf9: 8295666: Linux x86 build fails after 8292591
  • 5064718: 8294460: CodeSection::alignment checks for CodeBuffer::SECT_STUBS incorrectly
  • 8b010e0: 8030616: sun/management/jmxremote/bootstrap/RmiBootstrapTest fails intermittently with cannot find a free port
  • b35922b: 8295714: GHA ::set-output is deprecated and will be removed
  • dfd2d83: 8295657: SA: Allow larger object alignments
  • a345df2: 8280131: jcmd reports "Module jdk.jfr not found." when "jdk.management.jfr" is missing
  • ... and 56 more: https://git.openjdk.org/jdk/compare/5dbd49511518819acbbff9968cdf426af759cf2c...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 Pull request is ready to be integrated label Oct 18, 2022
@dean-long
Copy link
Member Author

Thanks Vladimir.

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.

Looks good to me.

@dean-long
Copy link
Member Author

Thanks Tobias.

@dean-long
Copy link
Member Author

@fisk, please take a look when you get the chance.

Copy link
Contributor

@fisk fisk left a comment

Choose a reason for hiding this comment

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

Looks good in general, but I have two questions.

CodeBlob* cb = CodeCache::find_blob(caller_pc);
if (cb == NULL || !cb->is_compiled() || entry_point == moop->get_c2i_entry()) {
if (cb == NULL || !cb->is_compiled() || callee->is_unloading()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not move the is_unloading check on callee to the if statement just above that checks the callee (as opposed to the callsite)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess I was thinking is_unloading() can be a bit expensive the first time it is called, so it might be better to fail for other reasons first. But I believe is_unloading will eventually be called for every nmethod each unloading cycle, so avoiding the cost here just means moving it to somewhere else. I can move it to where you suggest if you like.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay I see. I'll leave it to you to decide if you prefer to move it or not. I'm okay with it either way.

// Result from nmethod::is_unloading is not stable across safepoints.
NoSafepointVerifier nsv;

CompiledMethod* callee = moop->code();
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a moop->code() null check just a few lines below, so now it looks like we are reading the code pointer twice checking if it is null. Is ot enough to do that one time?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's actually the same number of null checks as before, if you look at what from_compiled_entry_no_trampoline() used to do. But I did consider removing the 2nd check, because no matter how late we check, we can always lose the race where it becomes null right after our last check. It's harmless however, so I decided to keep it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. That seems fine.

Copy link
Contributor

@fisk fisk left a comment

Choose a reason for hiding this comment

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

Looks good.

@dean-long
Copy link
Member Author

Thanks Erik.

@dean-long
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 22, 2022

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

  • 6acbdb5: 8295427: popframe004: report more details on error
  • 902162c: 8295239: Refactor java/util/Formatter/Basic script into a Java native test launcher
  • f5dabf9: 8295088: Update External Spec page to show tabs for hosts
  • 2181042: 8295375: debug agent class tracking should not piggy back on the cbClassPrepare() callback
  • f41711e: 8295650: JFR: jfr scrub should warn if an event type doesn't exist
  • 0c13d66: 8295530: Update Zlib Data Compression Library to Version 1.2.13
  • 15bebf9: 8295666: Linux x86 build fails after 8292591
  • 5064718: 8294460: CodeSection::alignment checks for CodeBuffer::SECT_STUBS incorrectly
  • 8b010e0: 8030616: sun/management/jmxremote/bootstrap/RmiBootstrapTest fails intermittently with cannot find a free port
  • b35922b: 8295714: GHA ::set-output is deprecated and will be removed
  • ... and 58 more: https://git.openjdk.org/jdk/compare/5dbd49511518819acbbff9968cdf426af759cf2c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 22, 2022
@openjdk openjdk bot closed this Oct 22, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 22, 2022
@openjdk
Copy link

openjdk bot commented Oct 22, 2022

@dean-long Pushed as commit b5efa2a.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants