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

8329488: Move OopStorage code from safepoint cleanup and remove safepoint cleanup code #18375

Closed
wants to merge 6 commits into from

Conversation

coleenp
Copy link
Contributor

@coleenp coleenp commented Mar 19, 2024

This patch gives the ServiceThread a periodic wakeup (same as GuaranteedSafepointInterval) to check if it needs to clean out OopStorage blocks, and move the triggering of this cleaning out of the safepoint cleanup tasks. Since ICBuffer, StringTable and SymbolTable rehashing have moved, there's nothing that actually triggers the nop safepoint to do cleaning (except SafepointALot), so the OopStorage cleanup won't be triggered.

With moving all of these out of the safepoint cleanup tasks, we can remove the code that sets up multiple threads to do safepoint cleanup. We can also remove the JFR events and logging that times safepoint cleanup, and a logging test.

Tested with tier1-4.


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-8329488: Move OopStorage code from safepoint cleanup and remove safepoint cleanup code (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18375

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 19, 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
Copy link

openjdk bot commented Mar 19, 2024

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

8329488: Move OopStorage code from safepoint cleanup and remove safepoint cleanup code

Reviewed-by: kbarrett, 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 102 new commits pushed to the master branch:

  • 63684cd: 8327250: assert(!method->is_old()) failed: Should not be installing old methods
  • ecc603c: 8201183: sjavac build failures: "Connection attempt failed: Connection refused"
  • ff5c9a4: 8329528: G1 does not update TAMS correctly when dropping retained regions during Concurrent Start pause
  • 9acce7a: 8329774: Break long lines in jdk/src/jdk.hotspot.agent/doc /transported_core.html
  • f0cd866: 8329704: Implement framework for proper handling of JDK_LIBS
  • 8817ba4: 8330000: ZGC: ZObjArrayAllocator may unnecessarily clear TypeArrays twice
  • f778642: 8330024: [AIX] replace my_disclaim64 helper by direct call to disclaim64
  • 7df4926: 8327741: JVM crash in hotspot/share/opto/compile.cpp - failed: missing inlining msg
  • 2ceeb6c: 8328822: C2: "negative trip count?" assert failure in profile predicate code
  • b04b304: 8329254: optimize integral reverse operations on x86 GFNI target.
  • ... and 92 more: https://git.openjdk.org/jdk/compare/28216aa971ea65938117107542152abd532a5384...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
Copy link

openjdk bot commented Mar 19, 2024

@coleenp 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 Mar 19, 2024
@coleenp coleenp changed the title Move OopStorage work to periodic service thread intervals. 8329488: Move OopStorage code from safepoint cleanup and remove safepoint cleanup code Apr 3, 2024
@coleenp coleenp marked this pull request as ready for review April 5, 2024 14:08
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 5, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 5, 2024

Webrevs

Copy link

@kimbarrett kimbarrett left a comment

Choose a reason for hiding this comment

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

Mostly looks good, with some remaining tidying up to do.

src/hotspot/share/gc/shared/oopStorage.cpp Show resolved Hide resolved
src/hotspot/share/gc/shared/oopStorage.cpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shared/oopStorage.cpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shared/oopStorage.cpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shared/oopStorage.cpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/shared/oopStorage.cpp Outdated Show resolved Hide resolved
src/hotspot/share/runtime/serviceThread.cpp Outdated Show resolved Hide resolved
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.

Looks like a good cleanup! Do we have any data on how often and how much oopStorage needs cleaning up? Any time you go to a polling based approach there are concerns that it may be to frequent or too infrequent. What kind of applications tend to require a lot of oopStorage cleaning?

src/hotspot/share/runtime/globals.hpp Outdated Show resolved Hide resolved
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.

I think I spotted a tiny issue otherwise this looks great!

src/hotspot/share/gc/shared/oopStorage.cpp Show resolved Hide resolved
@kimbarrett
Copy link

Looks like a good cleanup! Do we have any data on how often and how much oopStorage needs cleaning up? Any time you go to a polling based approach there are concerns that it may be to frequent or too infrequent. What kind of applications tend to require a lot of oopStorage cleaning?

It was previously intended to be polling too, via safepoint cleanups with the
minimum safepoint cleanup period. Except the latter has apparently not been
operative for some time. So in some sense the oopstorage related changes are
a bug fix. The chosen rates are (and were) pretty arbitrary.

We don't want unused blocks to hang around indefinitely. On the other hand,
it's wasteful to free empty blocks only to have the application need to
allocate new blocks soon after.

An application that allocates lots of storage entries, uses them for a while,
releases them, and is then quiescent (perhaps only for a while), may provide
grist for cleaning. String deduplication can have phases like that if some
strings are "medium" lifetime. I think graal (and maybe C2?) can have that
kind of phasing too.

Copy link

@kimbarrett kimbarrett 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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 10, 2024
@coleenp
Copy link
Contributor Author

coleenp commented Apr 12, 2024

Thank you for your review and comments, Erik and David, and your review and help with this PR, Kim.
/integrate

@openjdk
Copy link

openjdk bot commented Apr 12, 2024

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

  • 77a217d: 8330095: RISC-V: Remove obsolete vandn_vi instruction
  • 717a07b: 8322140: javax/swing/JTable/JTableScrollPrintTest.java does not print the rows and columns of the table in Nimbus and Aqua LookAndFeel
  • aebfd53: 8329660: G1: Improve TestGCLogMessages to be more precise
  • 006a516: 8329962: Remove CardTable::invalidate
  • c7fcd62: 8330006: Serial: Extract out ContiguousSpace::block_start_const
  • 2c8b432: 8330003: Serial: Move the logic of FastEvacuateFollowersClosure to SerialHeap
  • 2c45eca: 8328879: G1: Some gtests modify global state crashing the JVM during GC after JDK-8289822
  • bde3fc0: 8330106: C2: VectorInsertNode::make() shouldn't call ConINode::make() directly
  • e45fea5: 8329757: Crash with fatal error: DEBUG MESSAGE: Fast Unlock lock on stack
  • ece7d43: 8329416: Split relocation pointer map into read-write and read-only maps
  • ... and 108 more: https://git.openjdk.org/jdk/compare/28216aa971ea65938117107542152abd532a5384...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 12, 2024

@coleenp Pushed as commit 3e9c381.

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

@coleenp coleenp deleted the oopstorage branch April 12, 2024 12:17
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
Development

Successfully merging this pull request may close these issues.

4 participants