8300447: Parallel: Refactor PSPromotionManager::drain_stacks_depth#12063
8300447: Parallel: Refactor PSPromotionManager::drain_stacks_depth#12063albertnetymk wants to merge 2 commits intoopenjdk:masterfrom
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
|
| const uint threshold = totally_drain ? 0 | ||
| : _target_stack_size; |
There was a problem hiding this comment.
Feel free to ignore: I would prefer to not spread very simple ?: statements like this over multiple lines. This is imo less readable than keeping it in a single line (and ?: statements should always be very small/short anyway).
| process_popped_location_depth(task); | ||
| } | ||
|
|
||
| if (totally_drain) { | ||
| while (tq->pop_local(task)) { | ||
| process_popped_location_depth(task); | ||
| } | ||
| } else { | ||
| while (tq->size() > _target_stack_size && tq->pop_local(task)) { | ||
| process_popped_location_depth(task); | ||
| } | ||
| while (tq->pop_local(task, threshold)) { | ||
| process_popped_location_depth(task); | ||
| } | ||
| } while ((totally_drain && !tq->taskqueue_empty()) || !tq->overflow_empty()); | ||
| } while (!tq->overflow_empty()); |
There was a problem hiding this comment.
The other, similar loops like the ones in G1 (but also the ones for parallel full gc) all try to first feed the public queue from the overflow queue like (to avoid other threads from starving while this thread happily processes the overflow queue contents on its own):
do {
while (tq->pop_overflow(task)) {
if (!tq->try_push_to_taskqueue(task)) {
process_popped_location_depth(task);
}
}
while (tq->pop_local(task, threshold)) {
process_popped_location_depth(task);
}
} while (!tq->overflow_empty());
Is there a reason to not change the structure of this loop to that better one?
(I am also kind of surprised that this change has not been made yet)
|
@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 28 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 |
| const uint threshold = totally_drain ? 0 | ||
| : _target_stack_size; |
|
Thanks for the review. /integrate |
|
Going to push as commit 8f7faa6.
Your commit was automatically rebased without conflicts. |
|
@albertnetymk Pushed as commit 8f7faa6. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Simple refactoring based on the counterpart in G1.
Test: hotspot_gc
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12063/head:pull/12063$ git checkout pull/12063Update a local copy of the PR:
$ git checkout pull/12063$ git pull https://git.openjdk.org/jdk pull/12063/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12063View PR using the GUI difftool:
$ git pr show -t 12063Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12063.diff