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

8273476: G1: refine G1CollectedHeap::par_iterate_regions_array_part_from #5414

Conversation

@Hamlin-Li
Copy link

@Hamlin-Li Hamlin-Li commented Sep 8, 2021

G1CollectedHeap::par_iterate_regions_array_part_from is moved from G1CollectionSet::iterate_part_from in JDK-8254167.
The parameters and logic of this method could be refined a bit to make it more straight.


Progress

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

Issue

  • JDK-8273476: G1: refine G1CollectedHeap::par_iterate_regions_array_part_from

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5414

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 8, 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.

Loading

@openjdk openjdk bot added the rfr label Sep 8, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 8, 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.

Loading

@openjdk openjdk bot added the hotspot-gc label Sep 8, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 8, 2021

Loading

@@ -1161,7 +1161,6 @@ class G1CollectedHeap : public CollectedHeap {
void par_iterate_regions_array_part_from(HeapRegionClosure* cl,
Copy link
Member

@albertnetymk albertnetymk Sep 8, 2021

Choose a reason for hiding this comment

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

The comment needs to be updated as well. const uint* regions can be written as const uint regions[] to make the concept clearer, IMO.

Loading

Copy link
Author

@Hamlin-Li Hamlin-Li Sep 9, 2021

Choose a reason for hiding this comment

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

I have modified the function name too.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 8, 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:

8273476: G1: refine G1CollectedHeap::par_iterate_regions_array_part_from

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

  • aa93111: 8273483: Zero: Clear pending JNI exception check in native method handler
  • 8c16f48: 8273487: Zero: Handle "zero" variant in runtime tests
  • dc33bd8: 8273315: Parallelize and increase timeouts for java/foreign/TestMatrix.java test
  • 5b1dfe4: 8273439: Fix G1CollectedHeap includes and forward declarations
  • 6eba443: 8273387: remove some unreferenced gtk-related functions
  • 5df2648: 8273218: G1: Rename g1EvacuationInfo to g1EvacInfo
  • 12f0b77: 8273516: ProblemList compiler/c2/Test7179138_1.java in -Xcomp mode on win-X64
  • 7fd6b0b: 8273242: (test) Refactor to use TestNG for RuntimeTests ExecCommand tests
  • a5e4def: 8265489: Stress test times out because of long ObjectSynchronizer::monitors_iterate(...) operation
  • 9b5991e: 8273451: Remove unreachable return in mutexLocker::wait
  • ... and 15 more: https://git.openjdk.java.net/jdk/compare/a66629a464b97176bcdc2ca1150d12df6241dc1c...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.

Loading

@openjdk openjdk bot added the ready label Sep 8, 2021
_g1h->par_iterate_regions_array_part_from(cl,
hr_claimer,
&_collection_set_regions[offset],
length-offset,
Copy link
Contributor

@tschatzl tschatzl Sep 8, 2021

Choose a reason for hiding this comment

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

please add spaces around the - operator.

Loading

Copy link
Contributor

@tschatzl tschatzl left a comment

Lgtm.

Loading

_g1h->par_iterate_regions_array(cl,
hr_claimer,
&_collection_set_regions[offset],
length,
Copy link
Contributor

@tschatzl tschatzl Sep 9, 2021

Choose a reason for hiding this comment

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

This should be length - offset, shouldn't it?

Loading

Copy link
Contributor

@tschatzl tschatzl Sep 9, 2021

Choose a reason for hiding this comment

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

Suggested change
length,
length - offset,

Untested :)

Loading

Copy link
Author

@Hamlin-Li Hamlin-Li Sep 9, 2021

Choose a reason for hiding this comment

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

I thought so too at first, but seems it's not.
The passed in length in both G1CollectionSet::par_iterate/iterate_incremental_part_from are both the length of the "sub" array already. ( increment_length() is passed as length in iterate_incremental_part_from)
How do you think about it?

Loading

Copy link
Contributor

@tschatzl tschatzl Sep 9, 2021

Choose a reason for hiding this comment

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

You are right.

Loading

@@ -1155,15 +1155,14 @@ class G1CollectedHeap : public CollectedHeap {
collection_set_iterate_increment_from(blk, NULL, worker_id);
}
void collection_set_iterate_increment_from(HeapRegionClosure *blk, HeapRegionClaimer* hr_claimer, uint worker_id);
// Iterate part of an array of region indexes given by offset and length, applying
// Iterate an array of region indexes given by offset and length, applying
Copy link
Member

@albertnetymk albertnetymk Sep 9, 2021

Choose a reason for hiding this comment

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

Since there's no offset in the signature, how about "Iterate over the array, uint regions[length], applying ..."?

Loading

Copy link
Author

@Hamlin-Li Hamlin-Li Sep 9, 2021

Choose a reason for hiding this comment

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

Sure.

Loading

_g1h->par_iterate_regions_array(cl,
hr_claimer,
&_collection_set_regions[offset],
length,
Copy link
Contributor

@tschatzl tschatzl Sep 9, 2021

Choose a reason for hiding this comment

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

You are right.

Loading

@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Sep 9, 2021

I cancel the pre-submit tests for "Refine comments", the last successful run is at here https://github.com/Hamlin-Li/jdk/actions/runs/1216226352

Please kindly let me know if you have other comments, else I will push this later.

Loading

@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Sep 9, 2021

Thanks for your reviews, @tschatzl @albertnetymk

Loading

@Hamlin-Li
Copy link
Author

@Hamlin-Li Hamlin-Li commented Sep 9, 2021

/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 9, 2021

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

  • 00e059d: 8133686: HttpURLConnection.getHeaderFields and URLConnection.getRequestProperties methods return field values in reverse order
  • aa93111: 8273483: Zero: Clear pending JNI exception check in native method handler
  • 8c16f48: 8273487: Zero: Handle "zero" variant in runtime tests
  • dc33bd8: 8273315: Parallelize and increase timeouts for java/foreign/TestMatrix.java test
  • 5b1dfe4: 8273439: Fix G1CollectedHeap includes and forward declarations
  • 6eba443: 8273387: remove some unreferenced gtk-related functions
  • 5df2648: 8273218: G1: Rename g1EvacuationInfo to g1EvacInfo
  • 12f0b77: 8273516: ProblemList compiler/c2/Test7179138_1.java in -Xcomp mode on win-X64
  • 7fd6b0b: 8273242: (test) Refactor to use TestNG for RuntimeTests ExecCommand tests
  • a5e4def: 8265489: Stress test times out because of long ObjectSynchronizer::monitors_iterate(...) operation
  • ... and 16 more: https://git.openjdk.java.net/jdk/compare/a66629a464b97176bcdc2ca1150d12df6241dc1c...master

Your commit was automatically rebased without conflicts.

Loading

@openjdk openjdk bot closed this Sep 9, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Sep 9, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 9, 2021

@Hamlin-Li Pushed as commit 9690df7.

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

Loading

@Hamlin-Li Hamlin-Li deleted the refine-G1CollectedHeap-par_iterate_regions_array_part_from branch Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants