Skip to content

8253303 G1: Move static initialization of G1FromCardCache to a proper location #247

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

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Sep 18, 2020

in src/hotspot/share/gc/g1/g1RemSet.cpp:

488 void G1RemSet::initialize(uint max_reserved_regions) {
489 G1FromCardCache::initialize(num_par_rem_sets(), max_reserved_regions);
490 _scan_state->initialize(max_reserved_regions);
491 }

the static initialization is piggy-backed to G1RemSet instance initialization which is rather bad style. Fortunately there is only one G1RemSet instance and that method is only called once so no functional issue.

This change moves the initialization call, and after a bit of analysis move some more related code to more appropriate places.

Testing: local compilation, jtreg gc/g1, tier1-3 passed


Progress

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

Issue

  • JDK-8253303: G1: Move static initialization of G1FromCardCache to a proper location

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/247/head:pull/247
$ git checkout pull/247

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 18, 2020

👋 Welcome back tschatzl! 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 Sep 18, 2020
@openjdk
Copy link

openjdk bot commented Sep 18, 2020

@tschatzl 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 (add|remove) "label" command.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Sep 18, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 18, 2020

Webrevs

@mlbridge
Copy link

mlbridge bot commented Sep 18, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi,

On 18.09.20 15:22, Albert Mingkun Yang wrote:

thanks for your review.

Thomas

Copy link
Contributor

@kstefanj kstefanj left a comment

Choose a reason for hiding this comment

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

Nice cleanup Thomas, consider it approved.

Just one minor thing before integrating.

// Also create a G1 rem set.
_rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
_rem_set->initialize(max_reserved_regions());


Copy link
Contributor

@kstefanj kstefanj Sep 18, 2020

Choose a reason for hiding this comment

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

Please remove this additional line before integrating, unless you added it for good reason :)

@openjdk
Copy link

openjdk bot commented Sep 18, 2020

@tschatzl This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements

After integration, the commit message will be:

8253303: G1: Move static initialization of G1FromCardCache to a proper location

Reviewed-by: ayang, sjohanss
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 21 commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate 34ec1bedd1c2d774c52f3664f9b57a4422877bfe.

➡️ 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 Sep 18, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 21, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi Stefan, Albert,

thanks for your reviews.

On 18.09.20 22:09, Stefan Johansson wrote:

On Fri, 18 Sep 2020 11:17:08 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

in src/hotspot/share/gc/g1/g1RemSet.cpp:

488 void G1RemSet::initialize(uint max_reserved_regions) {
489 G1FromCardCache::initialize(num_par_rem_sets(), max_reserved_regions);
490 _scan_state->initialize(max_reserved_regions);
491 }

the static initialization is piggy-backed to G1RemSet instance initialization which is rather bad style. Fortunately
there is only one G1RemSet instance and that method is only called once so no functional issue.
This change moves the initialization call, and after a bit of analysis move some more related code to more appropriate
places.
Testing: local compilation, jtreg gc/g1, tier1-3 passed

Nice cleanup Thomas, consider it approved.

Just one minor thing before integrating.

src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 1690:

1688: _rem_set->initialize(max_reserved_regions());
1689:
1690:

Please remove this additional line before integrating, unless you added it for good reason :)

-------------

Done. Waiting a bit to push.

Thanks,
Thomas

@tschatzl
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Sep 21, 2020
@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 Sep 21, 2020
@openjdk
Copy link

openjdk bot commented Sep 21, 2020

@tschatzl Since your change was applied there have been 21 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 955c2e6.

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

@tschatzl tschatzl deleted the 8253303-move-g1fromcardcache-static-initialization branch September 22, 2020 18:20
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
Development

Successfully merging this pull request may close these issues.

3 participants