-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8279856: Parallel: Use PreservedMarks to record promotion-failed objects #7028
8279856: Parallel: Use PreservedMarks to record promotion-failed objects #7028
Conversation
👋 Welcome back ayang! A progress list of the required criteria for merging this PR into |
@albertnetymk The following label will be automatically applied to this pull request:
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. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
One think that would be interesting would be to do some measurements on the additional memory usage for the PreservedMarks
stack with this change. To better understand what kind of memory trade-off we do for the quicker processing.
@@ -360,7 +360,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markWord obj_mark) { | |||
|
|||
push_contents(obj); | |||
|
|||
_preserved_marks->push_if_necessary(obj, obj_mark); | |||
_preserved_marks->push_always(obj, obj_mark); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a comment here explaining that we use the preserved marks no only to preserved "special" marks but also to restore and clear the forwardning pointer in "normal" marks.
@@ -57,6 +57,7 @@ class PreservedMarks { | |||
public: | |||
size_t size() const { return _stack.size(); } | |||
inline void push_if_necessary(oop obj, markWord m); | |||
inline void push_always(oop obj, markWord m); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to just call this push()
like we had in the past and maybe also re-use it in push_if_necessary()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking push_always
makes a clearer contrast with its neighbor: the two are parallel and there's no interconnection/dependency btw them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but they do push elements the same way so it could be shared to avoid having to change two places if anything needs updating in the future. That said, the code is small and live close together so should be fine if you prefer it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better not to mix the two APIs. The duplication is very small after all.
RemoveForwardedPointerClosure remove_fwd_ptr_closure; | ||
young_gen->object_iterate(&remove_fwd_ptr_closure); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are removed, there is no longer any need to get heap
and young_gen
above either. I think the cleanest would be do directly use ParallelScavengeHeap::heap()
in:
NOT_PRODUCT(heap->reset_promotion_should_fail();)
It might actually be nice to have some log message for that memory usage somewhere; while I know there is no "framework" for that in Parallel/Serial, it would still be nice to have. |
@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:
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 289 new commits pushed to the
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
Thanks for the review. /integrate |
Going to push as commit 16ec47d.
Your commit was automatically rebased without conflicts. |
@albertnetymk Pushed as commit 16ec47d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Simple change of using
PreservedMarks
to skip young-gen walking in finding promotion-failed objs.Test: tier1-6
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7028/head:pull/7028
$ git checkout pull/7028
Update a local copy of the PR:
$ git checkout pull/7028
$ git pull https://git.openjdk.java.net/jdk pull/7028/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7028
View PR using the GUI difftool:
$ git pr show -t 7028
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7028.diff