Skip to content

Conversation

@tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Jul 15, 2022

Hi all,

please review this removal of the HeapRegion::_marked_bytes member that records the bytes marked below tams in the recent mark as it is not really interesting in the removed places. I added comments to give reasons for this removal in the particular places for your review.

Testing: jtreg gc/g1, gha

Thanks,
Thomas


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9511/head:pull/9511
$ git checkout pull/9511

Update a local copy of the PR:
$ git checkout pull/9511
$ git pull https://git.openjdk.org/jdk pull/9511/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9511

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9511.diff

Comment on lines -89 to -90
void assert_marked_words(HeapRegion* hr) {
assert((_marked_words * HeapWordSize) == hr->marked_bytes(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This use is for verification/debugging only and has been suggested to remove (the _marked_words member) here during review of the single bitmap change.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 15, 2022

👋 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.

total_live_bytes,
BOOL_TO_STR(selected_for_rebuild),
live_bytes,
r->marked_bytes(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At this point (scrubbing start) marked_bytes() contain the amount of marked bytes in the previous marking. This is not particularly interesting to see; live_bytes contains the current marked bytes below tams and is printed.

@openjdk openjdk bot changed the title 8290357 8290357: Drop HeapRegion::marked_bytes() Jul 15, 2022
}

void account_failed_region(HeapRegion* r) {
size_t used_words = r->marked_bytes() / HeapWordSize;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At this point, for evacuation failure regions, marked_bytes() == live_bytes() so it can be replaced without any change.


bool do_heap_region(HeapRegion* r) {
if (r->is_old()) {
size_t prev_live = r->marked_bytes();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think this has ever been intended (this is the marked bytes below TAMS, not including bytes between TAMS and top()), and for a lower estimate of amount of bytes reclaimed, live_bytes() is as good or better.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 15, 2022
@openjdk
Copy link

openjdk bot commented Jul 15, 2022

@tschatzl The following label will be automatically applied to this pull request:

  • hotspot

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 hotspot-dev@openjdk.org label Jul 15, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 15, 2022

Webrevs

void HeapRegion::note_self_forwarding_removal_start(bool during_concurrent_start,
bool during_conc_mark) {
// We always scrub the region to make sure the entire region is
// parsable after the self-forwarding point removal, and update _marked_bytes
Copy link
Member

@sangheon sangheon Aug 2, 2022

Choose a reason for hiding this comment

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

Need an update with the comment related to _marked_bytes.

Copy link
Member

@sangheon sangheon left a comment

Choose a reason for hiding this comment

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

Looks good.
Just minor nit regarding the remaining comment of _marked_bytes.

@openjdk
Copy link

openjdk bot commented Aug 2, 2022

@tschatzl this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout submit/8290357-remove-marked-bytes
git fetch https://git.openjdk.org/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Aug 2, 2022
@openjdk
Copy link

openjdk bot commented Aug 3, 2022

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

8290357: Drop HeapRegion::marked_bytes()

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

  • 7676be8: 8291037: Move PLAB resizing mechanism to G1EvacStats
  • 861cc67: 8291897: TerminatingThreadLocal(s) not registered from virtual thread(s)
  • 8d88be2: 8291459: JVM crash with GenerateOopMap::error_work(char const*, __va_list_tag*)
  • 8a804f6: 8291454: Missing check for JLI C runtime library in CoreLibraries.gmk
  • 5a539e8: 8291893: riscv: remove fence.i used in user space
  • b2f0cbd: 8064787: [macosx] In Nimbus LaF, Ctrl+Alt mnemonic doesn't work
  • 891df21: 8259687: JTabbedPane.setComponentAt doesn't hide previously visible tab component
  • d4fb91b: 8291956: Simplify the loop condition in sun.net.httpserver.Request constructor
  • 20123ea: 8291901: IGV: Preference menu disappears after JDK-8288750
  • 8e2c006: 8291957: Redundant import statements in sun.security.ec
  • ... and 52 more: https://git.openjdk.org/jdk/compare/0971d3464609bf4124df460ea73ff761d7e0f7b2...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 ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Aug 3, 2022
Copy link
Member

@walulyai walulyai left a comment

Choose a reason for hiding this comment

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

Lgtm!

@tschatzl
Copy link
Contributor Author

tschatzl commented Aug 8, 2022

Thanks @sangheon @walulyai for your reviews
/integrate

@openjdk
Copy link

openjdk bot commented Aug 8, 2022

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

  • 7676be8: 8291037: Move PLAB resizing mechanism to G1EvacStats
  • 861cc67: 8291897: TerminatingThreadLocal(s) not registered from virtual thread(s)
  • 8d88be2: 8291459: JVM crash with GenerateOopMap::error_work(char const*, __va_list_tag*)
  • 8a804f6: 8291454: Missing check for JLI C runtime library in CoreLibraries.gmk
  • 5a539e8: 8291893: riscv: remove fence.i used in user space
  • b2f0cbd: 8064787: [macosx] In Nimbus LaF, Ctrl+Alt mnemonic doesn't work
  • 891df21: 8259687: JTabbedPane.setComponentAt doesn't hide previously visible tab component
  • d4fb91b: 8291956: Simplify the loop condition in sun.net.httpserver.Request constructor
  • 20123ea: 8291901: IGV: Preference menu disappears after JDK-8288750
  • 8e2c006: 8291957: Redundant import statements in sun.security.ec
  • ... and 52 more: https://git.openjdk.org/jdk/compare/0971d3464609bf4124df460ea73ff761d7e0f7b2...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 8, 2022
@openjdk openjdk bot closed this Aug 8, 2022
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Aug 8, 2022
@tschatzl tschatzl deleted the submit/8290357-remove-marked-bytes branch August 8, 2022 13:29
@openjdk openjdk bot removed the rfr Pull request is ready for review label Aug 8, 2022
@openjdk
Copy link

openjdk bot commented Aug 8, 2022

@tschatzl Pushed as commit 4591937.

💡 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 hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants