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

8267834: Refactor G1CardSetAllocator and BufferNode::Allocator to use a common base class #7615

Closed

Conversation

walulyai
Copy link
Member

@walulyai walulyai commented Feb 24, 2022

Hi all,

Please review this change to combine free list allocation used in G1CardSetAllocator and BufferNode::Allocator into a single class.

Testing: Tier 1-5

Thanks
Ivan


Progress

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

Issue

  • JDK-8267834: Refactor G1CardSetAllocator and BufferNode::Allocator to use a common base class

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7615

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 24, 2022

👋 Welcome back iwalulya! 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 Feb 24, 2022
@openjdk
Copy link

openjdk bot commented Feb 24, 2022

@walulyai 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 Feb 24, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 24, 2022

Webrevs

#include "utilities/globalCounter.inline.hpp"

FreeListAllocator::NodeList::NodeList() :
_head(NULL), _tail(NULL), _entry_count(0) {}

Choose a reason for hiding this comment

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

NULL -> nullptr, here and elsewhere. Some code here is already adopting nullptr, and since this is "new" it should be consistent.

void FreeListAllocator::delete_list(FreeNode* list) {
while (list != NULL) {
FreeNode* next = list->next();
DEBUG_ONLY(list->set_next(NULL);)

Choose a reason for hiding this comment

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

Setting next to null isn't needed unless there's a null check in the destructor. The current destructor is defaulted. I think some predecessors to this code might have had a debug-only assert that next was null.

// method should be called before the ~FreeListAllocator(). Calling the reset
// method on nodes not managed by an arena will leak the memory by just dropping
// the nodes to the floor.
void FreeListAllocator::reset() {

Choose a reason for hiding this comment

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

I prefer this kind of API documentation in the header.

Copy link

@kimbarrett kimbarrett left a comment

Looks good.

@openjdk
Copy link

openjdk bot commented Feb 25, 2022

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

8267834: Refactor G1CardSetAllocator and BufferNode::Allocator to use a common base class

Reviewed-by: kbarrett, 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 34 new commits pushed to the master branch:

  • d3022f8: 8282467: add extra diagnostics for JDK-8268184
  • e4d9fc8: 8282023: PropertiesStoreTest and StoreReproducibilityTest jtreg failures due to en_CA locale
  • c1a28aa: 8282392: [zero] Build broken on AArch64
  • 7743266: 8281210: Add manpage changes for PAC-RET protection on Linux/AArch64
  • 1f89acd: 8282464: Remove author tags from java.compiler
  • 9d9618a: 8282462: Remove unnecessary use of @SuppressWarnings("preview")
  • d983d10: 8275731: CDS archived enums objects are recreated at runtime
  • c7cd148: 8282240: Add _name field to Method for NOT_PRODUCT only
  • 59b3ecc: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName
  • 4e7fb41: 8282172: CompileBroker::log_metaspace_failure is called from non-Java/compiler threads
  • ... and 24 more: https://git.openjdk.java.net/jdk/compare/0796620b07c6287a130ab0a3a7279d69b5d7b8a1...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 Feb 25, 2022
Copy link
Contributor

@tschatzl tschatzl left a comment

Lgtm.

@walulyai
Copy link
Member Author

walulyai commented Mar 1, 2022

Thanks @kimbarrett, @tschatzl for your reviews

/integrate

@openjdk
Copy link

openjdk bot commented Mar 1, 2022

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

  • fcce24c: 8281811: assert(_base == Tuple) failed: Not a Tuple after JDK-8280799
  • a95edee: 8281472: JVM options processing silently truncates large illegal options values
  • 44d599a: 8227369: pd_disjoint_words_atomic() needs to be atomic
  • eff396f: 8280713: Related to comment inheritance jdk.javadoc cleanup and refactoring
  • 369291b: 8282444: Module finder incorrectly assumes default file system path-separator character
  • d4d12ad: 8282047: Enhance StringDecode/Encode microbenchmarks
  • 22b93a3: 8282094: [REDO] Parallel: Refactor PSCardTable::scavenge_contents_parallel
  • d3022f8: 8282467: add extra diagnostics for JDK-8268184
  • e4d9fc8: 8282023: PropertiesStoreTest and StoreReproducibilityTest jtreg failures due to en_CA locale
  • c1a28aa: 8282392: [zero] Build broken on AArch64
  • ... and 31 more: https://git.openjdk.java.net/jdk/compare/0796620b07c6287a130ab0a3a7279d69b5d7b8a1...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Mar 1, 2022
@openjdk openjdk bot closed this Mar 1, 2022
@openjdk openjdk bot removed ready rfr labels Mar 1, 2022
@openjdk
Copy link

openjdk bot commented Mar 1, 2022

@walulyai Pushed as commit 341c8bd.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
3 participants