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

8273599: Remove cross_threshold method usage around GC #5469

Conversation

@tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Sep 10, 2021

HI all,

the cross_threshold() method is used in a few places to update the BOT after major changes to object locations (typically full gc compaction).

It has the following signature:

HeapWord* HeapRegion::cross_threshold(HeapWord* start, HeapWord* end);

to update the BOT for an object from start to end, returning the next (higher) address where there is need to call it again if advancing forward in the heap (i.e. basically after the last BOT entry that has just been written).

So it can be used in a loop to be only called in that case like this:

_compaction_top += size;
if (_compaction_top > _threshold) {
_threshold = _current_region->cross_threshold(_compaction_top - size, _compaction_top);
}

However the method it calls, alloc_block() does that check to shortcut unnecessary calls to some alloc_block_work() method already:

if (blk_end > _next_offset_threshold) {
  alloc_block_work(&_next_offset_threshold, blk_start, blk_end);
}

as cross_threshold() always returns _next_offset_threshold.

So the cross_threshold method and all the machinery to avoid unnecessary calls is... unnecessary.

No particular performance implications either way.

Testing: tier1-3, gc/g1

Thanks,
Thomas


Progress

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

Issue

  • JDK-8273599: Remove cross_threshold method usage around GC

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5469

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 10, 2021

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

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 10, 2021

@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 pull request command.

Loading

@openjdk openjdk bot added the hotspot-gc label Sep 10, 2021
@tschatzl tschatzl changed the title Remove cross_threshold 8273599: Remove cross_threshold method usage around GC Sep 10, 2021
@tschatzl tschatzl marked this pull request as ready for review Sep 10, 2021
@openjdk openjdk bot added the rfr label Sep 10, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 10, 2021

Webrevs

Loading

Copy link
Contributor

@kstefanj kstefanj left a comment

Nice find and good clean up. 👍

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 15, 2021

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

8273599: Remove cross_threshold method usage around GC

Reviewed-by: sjohanss, ayang

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

  • febcc72: 8273366: [testbug] javax/swing/UIDefaults/6302464/bug6302464.java fails on macOS12
  • 1017a2c: 8273135: java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java crashes in liblcms.dylib with NULLSeek+0x7
  • 6cf70f5: 8273638: javax/swing/JTable/4235420/bug4235420.java fails in GTK L&F
  • e66bf47: 8273414: ResourceObj::operator delete should handle nullptr in debug builds
  • 16c3ad1: 8272574: C2: assert(false) failed: Bad graph detected in build_loop_late
  • e7ab372: 8273641: (bf) Buffer subclasses documentation contains template strings
  • 22a7191: 8273040: Turning off JpAllowDowngrades (or Upgrades)
  • 394ebc8: 8270553: Tests should not use (real, in-use, routable) 1.1.1.1 as dummy IP value
  • 0f31d0f: 8273373: Zero: Cannot invoke JVM in primordial threads on Zero
  • fe89dd3: 8271254: javac generates unreachable code when using empty semicolon statement
  • ... and 44 more: https://git.openjdk.java.net/jdk/compare/2eaf374c5ce08287311cfac8145f97bf839365a7...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.

Loading

@openjdk openjdk bot added the ready label Sep 15, 2021
@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Sep 15, 2021

Thanks @albertnetymk @kstefanj for your reviews.

/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 15, 2021

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

  • 02af541: 8273605: VM Exit does not abort concurrent mark
  • febcc72: 8273366: [testbug] javax/swing/UIDefaults/6302464/bug6302464.java fails on macOS12
  • 1017a2c: 8273135: java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java crashes in liblcms.dylib with NULLSeek+0x7
  • 6cf70f5: 8273638: javax/swing/JTable/4235420/bug4235420.java fails in GTK L&F
  • e66bf47: 8273414: ResourceObj::operator delete should handle nullptr in debug builds
  • 16c3ad1: 8272574: C2: assert(false) failed: Bad graph detected in build_loop_late
  • e7ab372: 8273641: (bf) Buffer subclasses documentation contains template strings
  • 22a7191: 8273040: Turning off JpAllowDowngrades (or Upgrades)
  • 394ebc8: 8270553: Tests should not use (real, in-use, routable) 1.1.1.1 as dummy IP value
  • 0f31d0f: 8273373: Zero: Cannot invoke JVM in primordial threads on Zero
  • ... and 45 more: https://git.openjdk.java.net/jdk/compare/2eaf374c5ce08287311cfac8145f97bf839365a7...master

Your commit was automatically rebased without conflicts.

Loading

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

@openjdk openjdk bot commented Sep 15, 2021

@tschatzl Pushed as commit 92c30c9.

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

Loading

@tschatzl tschatzl deleted the submit/8273599-remove-cross-threshold branch Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants