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

8325437: Safepoint polling in monitor deflation can cause massive logs #17752

Conversation

stefank
Copy link
Member

@stefank stefank commented Feb 7, 2024

If -Xlog:monitorinflation=debug is used and ObjectSynchronizer::chk_in_use_entry is called while monitor deflation is safepoint polled/blocked, we can have deflated monitors on the in-use list and we can get a huge number of lines stating:

[10.570s][debug][monitorinflation] WARNING: monitor=0x00007fa1004f8480: in-use monitor is deflated.

This comes from the following code:

void ObjectSynchronizer::chk_in_use_entry(ObjectMonitor* n, outputStream* out,
                                          int* error_cnt_p) {
  if (n->owner_is_DEFLATER_MARKER()) {
    // This should not happen, but if it does, it is not fatal.
    out->print_cr("WARNING: monitor=" INTPTR_FORMAT ": in-use monitor is "
                  "deflated.", p2i(n));
    return;
  }

There are tentative plans to rewrite the monitor deflation to unlink deflated monitors from the in-use list before the safepoint polls, but I'd like to suggest that we make an interim patch that deletes this warning.


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-8325437: Safepoint polling in monitor deflation can cause massive logs (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17752

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 7, 2024

👋 Welcome back stefank! 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 Feb 7, 2024
@openjdk
Copy link

openjdk bot commented Feb 7, 2024

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Feb 7, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 7, 2024

Webrevs

Copy link
Member

@xmas92 xmas92 left a comment

Choose a reason for hiding this comment

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

Lgtm.

@openjdk
Copy link

openjdk bot commented Feb 7, 2024

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

8325437: Safepoint polling in monitor deflation can cause massive logs

Reviewed-by: aboldtch, dcubed, shade

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 Feb 7, 2024
@stefank
Copy link
Member Author

stefank commented Feb 8, 2024

Tier1-3 passes on Linux.

Copy link
Member

@dcubed-ojdk dcubed-ojdk left a comment

Choose a reason for hiding this comment

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

Sorry, I forgot to finish my review yesterday.

This looks fine. This WARNING mesg was from an era when I was trying to
make sure that idle ObjectMonitors were cleaned up as much as possible.
While that was a useful exercise when we were hunting down async monitor
deflation bugs, we're no longer trying to religiously make sure that idle
ObjectMonitors are deflated. Instead we're focused on trying to avoid inflation
unless absolutely necessary.

@stefank
Copy link
Member Author

stefank commented Feb 8, 2024

Thanks for reviewing!

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Ouch. Looks good!

@shipilev
Copy link
Member

shipilev commented Feb 8, 2024

Maybe you want to merge from latest master to get clean GHA run. It should contain the GHA fix: 3c91b59

@stefank
Copy link
Member Author

stefank commented Feb 9, 2024

Thanks, Aleksey for reviewing. GHA passes, so I'm integrating now.
/integrate

@openjdk
Copy link

openjdk bot commented Feb 9, 2024

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

  • 8b70b8d: 8325440: Confusing error reported for octal literals with wrong digits
  • 5daf622: 8325309: Amend "Listeners and Threads" in AWTThreadIssues.html
  • d165d12: 8325510: Serial: Remove redundant arg in non_clean_card_iterate

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 9, 2024

@stefank Pushed as commit 52d4976.

💡 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-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants