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

8277736: G1: Allow forced evacuation failure of first N regions in collection set #6561

Closed

Conversation

Hamlin-Li
Copy link

@Hamlin-Li Hamlin-Li commented Nov 25, 2021

Currently, debug options of evacuation failure, like G1EvacuationFailureALotInterval and G1EvacuationFailureALotCount only config the ratio of objects failing evacuation, basically the distribution of objects failing evacuation is even among regions.

JDK-8256265 is trying to improve parallelism in regions that failed evacuation, it'll be helpful if there is option to config the distribution of objects failing evacuation among regions, so implementation of JDK-8256265 could be profiled more precisely.

This is to add the support and necessary vm options, and the implementation will be to select regions from start, i.e. not randomly, the motivation is to configure a more stable selection of evacuation failure regions, which will help verify the effect of JDK-8256265 implementation.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issues

  • JDK-8277736: G1: Allow forced evacuation failure of first N regions in collection set
  • JDK-8278035: G1: Allow forced evacuation failure of first N regions in collection set (CSR) ⚠️ Issue is not open.

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6561/head:pull/6561
$ git checkout pull/6561

Update a local copy of the PR:
$ git checkout pull/6561
$ git pull https://git.openjdk.java.net/jdk pull/6561/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6561

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6561.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 25, 2021

👋 Welcome back mli! 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 label Nov 25, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 25, 2021

@Hamlin-Li 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 label Nov 25, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 25, 2021

Webrevs

if (_evac_failure_regions_num > 0) {
_regions.set_bit(r->hrm_index());
--_evac_failure_regions_num;
return false;
Copy link
Contributor

@tschatzl tschatzl Nov 25, 2021

Choose a reason for hiding this comment

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

Just an initial comment to think about and discuss: This would most likely always ever select the same regions (probably eden) that are first in the collection set.
I think selecting by probability (with G1EvacuationFailureALotCSetPercent uniform probability) would be more interesting even if it makes the selection more random.

Copy link
Author

@Hamlin-Li Hamlin-Li Nov 26, 2021

Choose a reason for hiding this comment

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

Yes, currently I only make it select regions starting from first.
The reason I don't add random selection is that, currently we need this functionality to verify the functionality and perf improvement of JDK-8256265 implementation, so a more stable selection of evacuation failure regions will help to verify the effect of JDK-8256265.

I agree that random selection is an interesting option to supply too, I just file https://bugs.openjdk.java.net/browse/JDK-8277851 to track the issue.

Copy link
Member

@albertnetymk albertnetymk Nov 30, 2021

Choose a reason for hiding this comment

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

This PR makes the first X% regions in cset evac-fail, but G1EvacuationFailureALotCSetPercent doesn't show such bias. (It kind of implies uniform distribution, IMO.) It would be nice if the name and/or the explanation string could be more specific.

@Hamlin-Li Hamlin-Li changed the title 8277736: G1: Configure the distribution of objects failing evacuation among regions 8277736: G1: Allow forced evacuation failure of first N regions in collection set Nov 29, 2021
@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Nov 29, 2021

kindly reminder ~

Copy link
Member

@albertnetymk albertnetymk left a comment

Just some minor comments/suggestions.

@@ -56,11 +56,17 @@ class G1YoungGCEvacFailureInjector {
// Used to determine whether evacuation failure injection should be in effect
// for the current GC.
size_t _last_collection_with_evacuation_failure;

// Records the regions that will fail evacuation.
CHeapBitMap _regions;
Copy link
Member

@albertnetymk albertnetymk Nov 30, 2021

Choose a reason for hiding this comment

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

How about calling this field _evac_fail_regions?

if (_evac_failure_regions_num > 0) {
_regions.set_bit(r->hrm_index());
--_evac_failure_regions_num;
return false;
Copy link
Member

@albertnetymk albertnetymk Nov 30, 2021

Choose a reason for hiding this comment

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

This PR makes the first X% regions in cset evac-fail, but G1EvacuationFailureALotCSetPercent doesn't show such bias. (It kind of implies uniform distribution, IMO.) It would be nice if the name and/or the explanation string could be more specific.

"evacuation pauses")
"evacuation pauses") \
\
product(uintx, G1EvacuationFailureALotCSetPercent, 100, \
Copy link
Member

@albertnetymk albertnetymk Nov 30, 2021

Choose a reason for hiding this comment

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

Why uintx? Does uint work?

Copy link
Author

@Hamlin-Li Hamlin-Li Dec 1, 2021

Choose a reason for hiding this comment

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

I will refine the explanation specifically.
As Thomas suggested, an random selection will be added later, I plan to add another bool option to indicate if it's random selection or not, so will keep G1EvacuationFailureALotCSetPercent.

Copy link
Contributor

@tschatzl tschatzl Dec 1, 2021

Choose a reason for hiding this comment

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

Another, imo better way would be allowing a string for the type of selection algorithm, like VerifyGCType, with current possible values being NthObject (or just default) and FirstRegions or so.

Copy link
Contributor

@tschatzl tschatzl Dec 1, 2021

Choose a reason for hiding this comment

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

That could be extended to RandomRegions later.

This needs another flag though, maybe something like G1EvacuationFailureALotObjectSelectionType (random name right now, probably you will come up with something better).

Copy link
Author

@Hamlin-Li Hamlin-Li Dec 1, 2021

Choose a reason for hiding this comment

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

I think you mean we add this option when implement https://bugs.openjdk.java.net/browse/JDK-8277851, am I right? If positive, sure, it make sense to me, it's much easier to extend the algorithms in the future.

Copy link
Contributor

@tschatzl tschatzl Dec 1, 2021

Choose a reason for hiding this comment

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

I am good with deferring the additional flag.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 30, 2021

@Hamlin-Li 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:

8277736: G1: Allow forced evacuation failure of first N regions in collection set

Reviewed-by: ayang, tschatzl

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

  • 0c29ee5: 8274319: Replace usages of Collections.sort with List.sort call in jdk.jfr
  • f505396: 8277459: Add jwebserver tool
  • 84aa0a1: 8278047: Few javax/imageio test regressed after JDK-8262297 fix
  • fde0b95: 8277861: Terminally deprecate Thread.stop
  • 70d5dff: 8275326: C2: assert(no_dead_loop) failed: dead loop detected
  • 349328c: 8277777: [Vector API] assert(r->is_XMMRegister()) failed: must be in x86_32.ad
  • c733193: 8262297: ImageIO.write() method will throw IndexOutOfBoundsException
  • da2be99: 8277026: Remove blank lines remaining from snippet markup
  • 0a01baa: 8277986: Typo in javadoc of java.util.zip.ZipEntry#setTime
  • 7049c13: 8231107: Allow store password to be null when saving a PKCS12 KeyStore
  • ... and 91 more: https://git.openjdk.java.net/jdk/compare/bb11c55dff86706a010c93ee2cc60c87bb2d53b6...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 label Nov 30, 2021
@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Dec 1, 2021

I created the correponding CSR for this issue: https://bugs.openjdk.java.net/browse/JDK-8278035

@openjdk openjdk bot added csr and removed ready labels Dec 1, 2021
@tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Dec 1, 2021

I created the correponding CSR for this issue: https://bugs.openjdk.java.net/browse/JDK-8278035

This change does not need a CSR - the flag is by default not available in a product build.

@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Dec 1, 2021

I created the correponding CSR for this issue: https://bugs.openjdk.java.net/browse/JDK-8278035

This change does not need a CSR - the flag is by default not available in a product build.

Thanks for pointing out, I just withdraw the CSR.

@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Dec 1, 2021

/csr unneeded

@openjdk openjdk bot removed the csr label Dec 1, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 2021

@Hamlin-Li determined that a CSR request is not needed for this pull request.

@openjdk openjdk bot added the ready label Dec 1, 2021
Copy link
Contributor

@tschatzl tschatzl left a comment

Looks good. Please improve the flag text before pushing though :)

"evacuation pauses")
"evacuation pauses") \
\
product(uintx, G1EvacuationFailureALotCSetPercent, 100, \
Copy link
Contributor

@tschatzl tschatzl Dec 1, 2021

Choose a reason for hiding this comment

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

I am good with deferring the additional flag.

"evacuation pauses") \
\
product(uintx, G1EvacuationFailureALotCSetPercent, 100, \
"Percent of the regions in cset that will fail evacuation") \
Copy link
Contributor

@tschatzl tschatzl Dec 1, 2021

Choose a reason for hiding this comment

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

Please spell out "cset" in the description text though as it is done everywhere else in g1_globals.hpp. Considering Albert's suggestion, maybe something like:

The percentage of regions in the collection set starting from the beginning where the forced evacuation failure injection will be applied.

Copy link
Author

@Hamlin-Li Hamlin-Li Dec 1, 2021

Choose a reason for hiding this comment

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

Sure. Thanks!

@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Dec 1, 2021

Thanks @tschatzl @albertnetymk for your reviews.

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 2021

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

  • 0c29ee5: 8274319: Replace usages of Collections.sort with List.sort call in jdk.jfr
  • f505396: 8277459: Add jwebserver tool
  • 84aa0a1: 8278047: Few javax/imageio test regressed after JDK-8262297 fix
  • fde0b95: 8277861: Terminally deprecate Thread.stop
  • 70d5dff: 8275326: C2: assert(no_dead_loop) failed: dead loop detected
  • 349328c: 8277777: [Vector API] assert(r->is_XMMRegister()) failed: must be in x86_32.ad
  • c733193: 8262297: ImageIO.write() method will throw IndexOutOfBoundsException
  • da2be99: 8277026: Remove blank lines remaining from snippet markup
  • 0a01baa: 8277986: Typo in javadoc of java.util.zip.ZipEntry#setTime
  • 7049c13: 8231107: Allow store password to be null when saving a PKCS12 KeyStore
  • ... and 91 more: https://git.openjdk.java.net/jdk/compare/bb11c55dff86706a010c93ee2cc60c87bb2d53b6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 1, 2021
@openjdk openjdk bot added integrated and removed ready labels Dec 1, 2021
@openjdk openjdk bot removed the rfr label Dec 1, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 2021

@Hamlin-Li Pushed as commit bc6dce1.

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

@Hamlin-Li Hamlin-Li deleted the G1EvacuationFailureALotCSetPercent branch Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
3 participants