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

8276299: G1: Unify the wording buffer/node/element in G1SegmentedArrayXxx, G1CardSetXxx and related classes #6605

Closed

Conversation

Hamlin-Li
Copy link

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

Currently, the words "buffer", "node" and "element" are used together in G1SegmentedArrayXxx, G1CardSetXxx and related classes in an inconsistent way, which is very unfavorable for understanding.

We should not confuse buffer and node together, and not confuse node and element together. The new wording should be based on something like the following rule:

segmented array (1) -- segment (N) -- slot (M)


Progress

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

Issue

  • JDK-8276299: G1: Unify the wording buffer/node/element in G1SegmentedArrayXxx, G1CardSetXxx and related classes

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6605

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 30, 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 30, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 30, 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 30, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 30, 2021

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

I think this is good apart from the minor formatting issues.

@@ -166,7 +166,7 @@ inline G1CardSetArray::G1CardSetArrayLocker::G1CardSetArrayLocker(EntryCountType

inline G1AddCardResult G1CardSetArray::add(uint card_idx) {
assert(card_idx < (1u << (sizeof(_data[0]) * BitsPerByte)),
"Card index %u does not fit card element.", card_idx);
"Card index %u does not fit card entry.", card_idx);
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.

Suggested change
"Card index %u does not fit card entry.", card_idx);
"Card index %u does not fit allowed card value range.", card_idx);

// A segmented array where G1SegmentedArrayBuffer is the segment, and
// G1SegmentedArrayBufferList is the free list to cache G1SegmentedArrayBuffer,
// A segmented array where G1SegmentedArraySegment is the segment, and
// G1SegmentedArrayFreeList is the free list to cache G1SegmentedArraySegment,
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.

Suggested change
// G1SegmentedArrayFreeList is the free list to cache G1SegmentedArraySegment,
// G1SegmentedArrayFreeList is the free list to cache G1SegmentedArraySegments,

G1SegmentedArrayFreeList<flag>* _free_segment_list; // The global free segment list to
// preferentially get new segments from.
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.

Suggested change
G1SegmentedArrayFreeList<flag>* _free_segment_list; // The global free segment list to
// preferentially get new segments from.
G1SegmentedArrayFreeList<flag>* _free_segment_list; // The global free segment list to
// preferentially get new segments from.

(not sure I got the alignment of the comment slashes with the section above correct :); but at least the slashes should be aligned within that comment)

guarantee(is_aligned(elem, _alloc_options->alignment()),
"result " PTR_FORMAT " not aligned at %u", p2i(elem), _alloc_options->alignment());
return elem;
Slot* slot = (Slot*) cur->get_new_slot();
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.

Suggested change
Slot* slot = (Slot*) cur->get_new_slot();
Slot* slot = (Slot*)cur->get_new_slot();

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.

Thanks! very detailed review!

@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 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:

8276299: G1: Unify the wording buffer/node/element in G1SegmentedArrayXxx, G1CardSetXxx and related classes

Reviewed-by: tschatzl, ayang, iwalulya

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

  • bc6dce1: 8277736: G1: Allow forced evacuation failure of first N regions in collection set
  • 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
  • ... and 39 more: https://git.openjdk.java.net/jdk/compare/8f9eb620acbc447cf9124b1fe5574a9f02115f45...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 Dec 1, 2021
Copy link
Member

@albertnetymk albertnetymk left a comment

Just a minor comment.

class G1SegmentedArrayBufferList {
static G1SegmentedArrayBuffer<flag>* volatile* next_ptr(G1SegmentedArrayBuffer<flag>& node) {
return node.next_addr();
class G1SegmentedArrayFreeList {
Copy link
Member

@albertnetymk albertnetymk Dec 1, 2021

Choose a reason for hiding this comment

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

The name should be G1SegmentedArraySegmentList, right?

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.

Thanks Albert.
In fact I intended to change it "G1SegmentedArrayFreeList", I think this is more readable, and G1SegmentedArraySegmentList is a bit redundant.
Please kindly let me know if you think otherwise.

Copy link
Member

@albertnetymk albertnetymk Dec 1, 2021

Choose a reason for hiding this comment

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

There's a class named G1SegmentedArraySegment, so having G1SegmentedArraySegmentList as a list of G1SegmentedArraySegment makes perfect sense and is more consistent, IMO. Ofc, this is quite subjective; either is fine to me.

Copy link
Author

@Hamlin-Li Hamlin-Li Dec 2, 2021

Choose a reason for hiding this comment

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

Thanks Albert, I'll keep "G1SegmentedArrayFreeList". :)

@Hamlin-Li
Copy link
Author

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

Thanks @tschatzl @albertnetymk @walulyai for your reviews.

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Dec 2, 2021

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

  • 51d6d7a: 8266839: Enable pandoc on macosx-aarch64 at Oracle
  • 0dfb3a7: 8268582: javadoc throws NPE with --ignore-source-errors option
  • f41e768: 8277762: Allow configuration of HOTSPOT_BUILD_USER
  • a363b7b: 8177819: DateTimeFormatterBuilder zone parsing should recognise DST
  • 9b3e672: 8278014: [vectorapi] Remove test run script
  • 1e9ed54: 8193682: Infinite loop in ZipOutputStream.close()
  • abaa073: 8277946: NMT: Deprecate and remove VM.native_memory shutdown jcmd command option
  • 37ff7f3: 8277866: gc/epsilon/TestMemoryMXBeans.java failed with wrong initial heap size
  • 8d7958e: 8277981: String Deduplication table is never cleaned up due to bad dead_factor_for_cleanup
  • bc6dce1: 8277736: G1: Allow forced evacuation failure of first N regions in collection set
  • ... and 48 more: https://git.openjdk.java.net/jdk/compare/8f9eb620acbc447cf9124b1fe5574a9f02115f45...master

Your commit was automatically rebased without conflicts.

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

@openjdk openjdk bot commented Dec 2, 2021

@Hamlin-Li Pushed as commit 67745fa.

💡 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 unify-wording-buffer-node-element 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
4 participants