Skip to content

8269870: PS: Membar in PSPromotionManager::copy_unmarked_to_survivor_space could be relaxed#19764

Closed
albertnetymk wants to merge 2 commits intoopenjdk:masterfrom
albertnetymk:pgc-relax-forward
Closed

8269870: PS: Membar in PSPromotionManager::copy_unmarked_to_survivor_space could be relaxed#19764
albertnetymk wants to merge 2 commits intoopenjdk:masterfrom
albertnetymk:pgc-relax-forward

Conversation

@albertnetymk
Copy link
Member

@albertnetymk albertnetymk commented Jun 18, 2024

The acquire-release mem-barrier was probably used/required before but not any more. Inspiration taken from G1ParScanThreadState::do_oop_evac.


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

  • JDK-8269870: PS: Membar in PSPromotionManager::copy_unmarked_to_survivor_space could be relaxed (Enhancement - P4)

Reviewers

Contributors

  • Hamlin Li <mli@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19764

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 18, 2024

👋 Welcome back ayang! 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
Copy link

openjdk bot commented Jun 18, 2024

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

8269870: PS: Membar in PSPromotionManager::copy_unmarked_to_survivor_space could be relaxed

Co-authored-by: Hamlin Li <mli@openjdk.org>
Reviewed-by: mli, 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 75 new commits pushed to the master branch:

  • a5f401f: 8334650: Add debug information about whether an Assertion Predicate is for the init or last value
  • 25c3845: 8333133: Simplify QuickSort::sort
  • c66f785: 8334505: RISC-V: Several tests fail when MaxVectorSize does not match VM_Version::_initial_vector_length
  • f101e15: 8333583: Crypto-XDH.generateSecret regression after JDK-8329538
  • b3bf31a: 8333542: Breakpoint in parallel code does not work
  • 86b0cf2: 8334653: ISO 4217 Amendment 177 Update
  • 861aefc: 8334418: Update IANA Language Subtag Registry to Version 2024-06-14
  • f8bf470: 8334810: Redo: Un-ProblemList LocaleProvidersRun and CalendarDataRegression
  • 933eaba: 8334629: [BACKOUT] PhaseIdealLoop::conditional_move is too conservative
  • 7429c37: 8334598: Default classlist in JDK is not deterministic after JDK-8293980
  • ... and 65 more: https://git.openjdk.org/jdk/compare/78682fe78e18268b1857855c3595b4d118808c66...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 changed the title 8269870 8269870: PS: Membar in PSPromotionManager::copy_unmarked_to_survivor_space could be relaxed Jun 18, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 18, 2024
@albertnetymk
Copy link
Member Author

/contributor add mli

@openjdk
Copy link

openjdk bot commented Jun 18, 2024

@albertnetymk
Contributor Hamlin Li <mli@openjdk.org> successfully added.

@openjdk
Copy link

openjdk bot commented Jun 18, 2024

@albertnetymk 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 hotspot-gc-dev@openjdk.org label Jun 18, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 18, 2024

Webrevs

Copy link

@Hamlin-Li Hamlin-Li 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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 18, 2024
@Hamlin-Li
Copy link

Thanks for working on this. :)

I suppose with the removal of OrderAccess::acquire();, it brings even more benefit?

@openjdk
Copy link

openjdk bot commented Jun 19, 2024

@albertnetymk Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@albertnetymk
Copy link
Member Author

Missed the acquire in the cas-fail path in the first version. Fixed now.

// Now we have to CAS in the header.
// Make copy visible to threads reading the forwardee.
oop forwardee = o->forward_to_atomic(new_obj, test_mark, memory_order_release);
oop forwardee = o->forward_to_atomic(new_obj, test_mark, memory_order_relaxed);

Choose a reason for hiding this comment

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

I think this needs a comment similar to what's in G1ParScanThreadState::do_copy_to_suvivor_space, e.g.

// Because the forwarding is done with memory_order_relaxed there is no
// ordering with the above copy. Clients that get the forwardee must not
// examine its contents without other synchronization, since the contents
// may not be up to date for them.

Copy link

@kimbarrett kimbarrett 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.

Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

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

Lgtm.

Fwiw, now that it is established that nobody is looking at the object's contents, PR#17227 can be resurrected too.

@albertnetymk
Copy link
Member Author

Thanks for review.

/integrate

@openjdk
Copy link

openjdk bot commented Jun 26, 2024

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

  • a5f401f: 8334650: Add debug information about whether an Assertion Predicate is for the init or last value
  • 25c3845: 8333133: Simplify QuickSort::sort
  • c66f785: 8334505: RISC-V: Several tests fail when MaxVectorSize does not match VM_Version::_initial_vector_length
  • f101e15: 8333583: Crypto-XDH.generateSecret regression after JDK-8329538
  • b3bf31a: 8333542: Breakpoint in parallel code does not work
  • 86b0cf2: 8334653: ISO 4217 Amendment 177 Update
  • 861aefc: 8334418: Update IANA Language Subtag Registry to Version 2024-06-14
  • f8bf470: 8334810: Redo: Un-ProblemList LocaleProvidersRun and CalendarDataRegression
  • 933eaba: 8334629: [BACKOUT] PhaseIdealLoop::conditional_move is too conservative
  • 7429c37: 8334598: Default classlist in JDK is not deterministic after JDK-8293980
  • ... and 65 more: https://git.openjdk.org/jdk/compare/78682fe78e18268b1857855c3595b4d118808c66...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 26, 2024
@openjdk openjdk bot closed this Jun 26, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 26, 2024
@openjdk
Copy link

openjdk bot commented Jun 26, 2024

@albertnetymk Pushed as commit b88af94.

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

@albertnetymk albertnetymk deleted the pgc-relax-forward branch June 26, 2024 07:40
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.

4 participants