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

JDK-8267562: G1: Missing BOT in Open Archive regions causes long pauses #4265

Closed
wants to merge 3 commits into from

Conversation

jianglizhou
Copy link
Contributor

@jianglizhou jianglizhou commented May 31, 2021

Populate G1BlockOffsetTableParts and associated G1BlockOffsetTable::_offset_array entries for 'open' archive regions during VM initialization at runtime.

G1BlockOffsetTable divides the covered space (Java heap) into “N”-word subregions (“N” is from 2^”LogN”). It uses an _offset_array to tell how far back it must go to find the start of a block that contains the first word of a subregion. Every G1 region (is a G1ContiguousSpace) owns a G1BlockOffsetTablePart (associates to part of the _offset_array), which covers space of the current region. For a mapped open archive heap region with pre-populated Java objects, its G1BlockOffsetTablePart is never setup at runtime because there is no allocation done within the region. As a result, G1BlockOffsetTablePart::block_start() always does lookup from the start (bottom) of an open archive region when called at runtime, regardless if the given 'addr' is near the bottom, top or in the middle of the region. The lookup becomes linear, instead of O(2^LogN). Large heap region size makes the situation worse and young-gen pauses longer.

Removed G1FullGCPrepareTask::G1CalculatePointersClosure::update_bot (introduced by JDK-8264987 change, #3459). It's merged as G1BlockOffsetTablePart::update, which is used for Survivor-turned-to-Old regions in full gc and open archive region. Thanks Thomas Schatzl for pointing to JDK-8264987 change for code reuse.

Tested with tier1 and hotspot_gc tests on linux_x86. Appreciate any help for testing other platforms and more tiers. Thanks!


Progress

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

Issue

  • JDK-8267562: G1: Missing BOT in Open Archive regions causes long pauses

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4265

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented May 31, 2021

👋 Welcome back jiangli! 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 May 31, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 31, 2021

@jianglizhou 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 May 31, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented May 31, 2021

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Lgtm apart from the comment issue.


// Populate the open archive regions' G1BlockOffsetTableParts. That ensures
// fast G1BlockOffsetTablePart::block_start operations for a given address
// within the open archive regions during G1RemSet::refine_card_concurrently.
Copy link
Contributor

@tschatzl tschatzl May 31, 2021

Choose a reason for hiding this comment

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

Not only refinement is subject to the issue but any operation trying to find start of an object (e.g. card table scanning). Please fix the comment accordingly.

Copy link
Contributor Author

@jianglizhou jianglizhou May 31, 2021

Choose a reason for hiding this comment

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

Updated comment based on the feedback from Thomas. Thanks for the review.

@openjdk
Copy link

@openjdk openjdk bot commented May 31, 2021

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

8267562: G1: Missing BOT in Open Archive regions causes long pauses

Reviewed-by: tschatzl, mli

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 26 new 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 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 May 31, 2021
Copy link

@Hamlin-Li Hamlin-Li left a comment

looks good.

@jianglizhou
Copy link
Contributor Author

@jianglizhou jianglizhou commented May 31, 2021

looks good.

Thanks for the review.

Copy link
Contributor

@tschatzl tschatzl left a comment

One last comment change :)

// This is only needed for open archive regions, but not the closed archive
// regions, because objects in closed archive regions are 'immutable'.
Copy link
Contributor

@tschatzl tschatzl Jun 1, 2021

Choose a reason for hiding this comment

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

Suggested change
// This is only needed for open archive regions, but not the closed archive
// regions, because objects in closed archive regions are 'immutable'.
// This is only needed for open archive regions, but not the closed archive
// regions, because objects in closed archive regions never reference objects
// outside the closed archive regions and they are immutable, so we never
// need their BOT during garbage collection.

@jianglizhou
Copy link
Contributor Author

@jianglizhou jianglizhou commented Jun 1, 2021

One last comment change :)

Thank for the suggestion. That does explain more clearly. Updated as suggested.

@jianglizhou
Copy link
Contributor Author

@jianglizhou jianglizhou commented Jun 1, 2021

/integrate

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

@openjdk openjdk bot commented Jun 1, 2021

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

Your commit was automatically rebased without conflicts.

Pushed as commit b17b11e.

💡 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