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

8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects #17141

Closed
wants to merge 2 commits into from

Conversation

fisk
Copy link
Contributor

@fisk fisk commented Dec 18, 2023

When cloning object arrays, we should do something more similar to arraycopy. The intrinsics for C2 already do that, but there are colder paths where the runtime version of cloning is used, and objects being cloned can potentially end up in the old generation. This could hypothetically be a problem if the source object is being concurrently modified by an external thread, storing store good pointers into its elements. Then, the destination array will look like it doesn't need any store barriers, while in fact no entries have been inserted to the remembered set.

This patch modifies cold object array cloning to be done more like array copy and relaxes the related assert for primitive arrays, which is what triggered the assertion that opened this investigation.

I have tested generational ZGC tier 1-7, general testing tier 1-5, and confirmed the individual test that triggered the assert triggers without this fix and doesn't trigger with this fix.


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-8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects (Bug - P1)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17141

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 18, 2023

👋 Welcome back eosterlund! 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 Dec 18, 2023
@openjdk
Copy link

openjdk bot commented Dec 18, 2023

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

  • hotspot-gc

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

mlbridge bot commented Dec 18, 2023

Webrevs

Copy link
Member

@stefank stefank 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
Copy link

openjdk bot commented Dec 19, 2023

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

8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects

Reviewed-by: stefank, sjohanss

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

  • ac968c3: 8319451: PhaseIdealLoop::conditional_move is too conservative
  • 0ad6c9e: 8322255: Generational ZGC: ZPageSizeMedium should be set before MaxTenuringThreshold
  • fff2e58: 8322195: RISC-V: Minor improvement of MD5 instrinsic
  • 7b4d62c: 8322300: Remove redundant arg in PSAdaptiveSizePolicy::adjust_promo_for_pause_time
  • 76637c5: 8321648: Integral gather optimized mask computation.
  • 59073fa: 8322154: RISC-V: JDK-8315743 missed change in MacroAssembler::load_reserved
  • 808a039: 8321815: Shenandoah: gc state should be synchronized to java threads only once per safepoint
  • 459957f: 8322062: com/sun/jdi/JdwpAllowTest.java does not performs negative testing with prefix length
  • b98d13f: 8259637: java.io.File.getCanonicalPath() returns different values for same path
  • 4f3de09: 8321940: Improve CDSHeapVerifier in handling of interned strings
  • ... and 64 more: https://git.openjdk.org/jdk/compare/2611a49ea13ee7a07f22692c3a4b32856ec5898f...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 Dec 19, 2023
Copy link
Contributor

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

@fisk
Copy link
Contributor Author

fisk commented Dec 19, 2023

Thanks for the reviews @stefank and @kstefanj!

/integrate

@openjdk
Copy link

openjdk bot commented Dec 19, 2023

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

  • ac968c3: 8319451: PhaseIdealLoop::conditional_move is too conservative
  • 0ad6c9e: 8322255: Generational ZGC: ZPageSizeMedium should be set before MaxTenuringThreshold
  • fff2e58: 8322195: RISC-V: Minor improvement of MD5 instrinsic
  • 7b4d62c: 8322300: Remove redundant arg in PSAdaptiveSizePolicy::adjust_promo_for_pause_time
  • 76637c5: 8321648: Integral gather optimized mask computation.
  • 59073fa: 8322154: RISC-V: JDK-8315743 missed change in MacroAssembler::load_reserved
  • 808a039: 8321815: Shenandoah: gc state should be synchronized to java threads only once per safepoint
  • 459957f: 8322062: com/sun/jdi/JdwpAllowTest.java does not performs negative testing with prefix length
  • b98d13f: 8259637: java.io.File.getCanonicalPath() returns different values for same path
  • 4f3de09: 8321940: Improve CDSHeapVerifier in handling of interned strings
  • ... and 64 more: https://git.openjdk.org/jdk/compare/2611a49ea13ee7a07f22692c3a4b32856ec5898f...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 19, 2023

@fisk Pushed as commit be49dab.

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

@fisk
Copy link
Contributor Author

fisk commented Dec 19, 2023

/backport jdk22

@openjdk
Copy link

openjdk bot commented Dec 19, 2023

@fisk the backport was successfully created on the branch backport-fisk-be49dabd in my personal fork of openjdk/jdk22. To create a pull request with this backport targeting openjdk/jdk22:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit be49dabd from the openjdk/jdk repository.

The commit being backported was authored by Erik Österlund on 19 Dec 2023 and was reviewed by Stefan Karlsson and Stefan Johansson.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22:

$ git fetch https://github.com/openjdk-bots/jdk22.git backport-fisk-be49dabd:backport-fisk-be49dabd
$ git checkout backport-fisk-be49dabd
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22.git backport-fisk-be49dabd

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