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

8276670: G1: Rename G1CardSetFreePool and related classes #6514

Closed

Conversation

Hamlin-Li
Copy link

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

As G1CardSetFreePool and related classes are going to be reused outside of the remembered set, they should be renamed.


Progress

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

Issue

  • JDK-8276670: G1: Rename G1CardSetFreePool and related classes

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6514

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 23, 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 Pull request is ready for review label Nov 23, 2021
@openjdk
Copy link

openjdk bot commented Nov 23, 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 hotspot-gc-dev@openjdk.org label Nov 23, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 23, 2021

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Lgtm. Thanks for fixing some pre-existing include-orderings...

@openjdk
Copy link

openjdk bot commented Nov 24, 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:

8276670: G1: Rename G1CardSetFreePool and related classes

Reviewed-by: tschatzl, ayang

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

  • 040b2c5: 8277139: Improve code readability in PredecessorValidator (c1_IR.cpp)
  • 3e798dd: 8275330: C2: assert(n->is_Root() || n->is_Region() || n->is_Phi() || n->is_MachMerge() || def_block->dominates(block)) failed: uses must be dominated by definitions
  • 99e4bda: 8277417: C1 LIR instruction for load-klass
  • 00a6238: 8277508: need to check has_predicated_vectors before calling scalable_predicate_reg_slots
  • 3383c0d: 8277659: [TESTBUG] Microbenchmark ThreadOnSpinWaitProducerConsumer.java hangs
  • 7e54d06: 8277165: jdeps --multi-release --print-module-deps fails if module-info.class in different versioned directories
  • eb4d886: 8277504: Use String.stripTrailing instead of hand-crafted method in SwingUtilities2
  • 9879920: 8277825: Remove unused ReferenceProcessorPhaseTimes::_sub_phases_total_time_ms
  • f788834: 8277786: G1: Rename log2_card_region_per_heap_region used in G1CardSet
  • 3034ae8: 8277631: ZGC: CriticalMetaspaceAllocation asserts
  • ... and 37 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 Pull request is ready to be integrated label Nov 24, 2021
Copy link
Member

@albertnetymk albertnetymk left a comment

Some minor comments/suggestions.

for (uint i = 0; i < num_mem_object_types(); i++) {
result._num_mem_sizes[i] += _allocators[i].mem_size();
result._num_buffers[i] += _allocators[i].num_buffers();
result._num_segments[i] += _allocators[i].num_buffers();
Copy link
Member

@albertnetymk albertnetymk Nov 24, 2021

Choose a reason for hiding this comment

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

I see a few other places where buffer is not renamed to segment. Having a dedicated PR for buffer -> segment renaming can increase the cohesion of each PR, IMO.

@@ -144,7 +144,7 @@ class G1CardSetMemoryManager : public CHeapObj<mtGCCardSet> {
uint num_mem_object_types() const;
public:
G1CardSetMemoryManager(G1CardSetConfiguration* config,
G1CardSetFreePool* free_list_pool);
G1SegmentedArrayFreePool<mtGCCardSet>* free_list_pool);
Copy link
Member

@albertnetymk albertnetymk Nov 24, 2021

Choose a reason for hiding this comment

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

Instead of using G1SegmentedArrayFreePool<mtGCCardSet> explicitly, I think the current name, G1CardSetFreePool, is more meaningful in this context (user site).

Therefore, I wonder if it's possible to place using G1CardSetFreePool = G1SegmentedArrayFreePool<mtGCCardSet> somewhere and keep using the current name.

Copy link
Author

@Hamlin-Li Hamlin-Li Nov 25, 2021

Choose a reason for hiding this comment

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

good idea!

public:

size_t _num_mem_sizes[G1CardSetConfiguration::num_mem_object_types()];
size_t _num_buffers[G1CardSetConfiguration::num_mem_object_types()];
size_t _num_segments[G1CardSetConfiguration::num_mem_object_types()];
Copy link
Member

@albertnetymk albertnetymk Nov 24, 2021

Choose a reason for hiding this comment

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

It's a bit odd to have G1CardSetXXX embedded inside this class. Can be fixed in a followup PR.

// The global free pool.
static G1CardSetFreePool _freelist_pool;
static G1SegmentedArrayFreePool<flag> _freelist_pool;
Copy link
Member

@albertnetymk albertnetymk Nov 24, 2021

Choose a reason for hiding this comment

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

I think one can drop <flag> here and in other similar places

@@ -82,14 +83,14 @@ class G1CardSetFreeMemoryTask : public G1ServiceTask {
jlong reschedule_delay_ms() const;

public:
explicit G1CardSetFreeMemoryTask(const char* name);
explicit G1SegmentedArrayFreeMemoryTask(const char* name);
Copy link
Member

@albertnetymk albertnetymk Nov 24, 2021

Choose a reason for hiding this comment

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

Looking at the call-site and implementation of execute() method, I am not sure this class is generic enough to be called G1SegmentedArrayFreeMemoryTask. (Maybe this class will be used for sth other than Card Set in the near future?)

Copy link
Author

@Hamlin-Li Hamlin-Li Nov 25, 2021

Choose a reason for hiding this comment

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

Yes, it will be used by some other places, e.g. evecuation failure processing. This class and related others will be refactored further to be more generic after the move and rename.

Copy link
Member

@albertnetymk albertnetymk left a comment

  1. There are still a few places where G1SegmentedArrayFreePool<mtGCCardSet> is used, instead of G1CardSetFreePool. I am not entirely sure if that's intended.

  2. It's undesirable to include some buffer -> segment renames in this PR.

Both are very subjective though.

@Hamlin-Li
Copy link
Author

Hamlin-Li commented Nov 27, 2021

  1. There are still a few places where G1SegmentedArrayFreePool<mtGCCardSet> is used, instead of G1CardSetFreePool. I am not entirely sure if that's intended.

Yes, it's intended, will be refactored in later related pr.

  1. It's undesirable to include some buffer -> segment renames in this PR.

I see, will pay attention in the future.

Both are very subjective though.

Thanks for detailed comments. :)

@Hamlin-Li
Copy link
Author

Hamlin-Li commented Nov 27, 2021

Thanks @tschatzl @albertnetymk for your reviews.

/integrate

@openjdk
Copy link

openjdk bot commented Nov 27, 2021

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

  • b9eb532: 8276685: Malformed Javadoc inline tags in JDK source in /jdk/management/jfr/RecordingInfo.java
  • 40fef23: 8275908: Record null_check traps for calls and array_check traps in the interpreter
  • 3d810ad: 8277411: C2 fast_unlock intrinsic on AArch64 has unnecessary ownership check
  • ce0234b: 8277860: PPC: Remove duplicate info != NULL check
  • 040b2c5: 8277139: Improve code readability in PredecessorValidator (c1_IR.cpp)
  • 3e798dd: 8275330: C2: assert(n->is_Root() || n->is_Region() || n->is_Phi() || n->is_MachMerge() || def_block->dominates(block)) failed: uses must be dominated by definitions
  • 99e4bda: 8277417: C1 LIR instruction for load-klass
  • 00a6238: 8277508: need to check has_predicated_vectors before calling scalable_predicate_reg_slots
  • 3383c0d: 8277659: [TESTBUG] Microbenchmark ThreadOnSpinWaitProducerConsumer.java hangs
  • 7e54d06: 8277165: jdeps --multi-release --print-module-deps fails if module-info.class in different versioned directories
  • ... and 41 more: https://git.openjdk.java.net/jdk/compare/bb11c55dff86706a010c93ee2cc60c87bb2d53b6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 27, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 27, 2021
@openjdk
Copy link

openjdk bot commented Nov 27, 2021

@Hamlin-Li Pushed as commit e9b36a8.

💡 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 rename-G1CardSetFreePool-out branch Nov 29, 2021
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