-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8315219: G1: Improve allocator pathological case where it keeps doing direct allocations instead of retiring a PLAB #15482
Conversation
👋 Welcome back iwalulya! A progress list of the required criteria for merging this PR into |
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.
Apart from that casing issue, looks good.
@@ -62,17 +63,18 @@ public class TestPLABPromotion { | |||
private final static String PLAB_DIRECT_ALLOCATED_FIELD_NAME = "direct allocated"; | |||
private final static List<String> FIELDS_TO_EXTRACT = Arrays.asList(PLAB_USED_FIELD_NAME, PLAB_DIRECT_ALLOCATED_FIELD_NAME); | |||
|
|||
public final static int heapWordSize = Platform.is32bit() ? 4 : 8; |
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 would prefer to keep using the existing style for static final
s.
@walulyai 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 12 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 |
|
||
PLAB* alloc_buf = alloc_buffer(dest, node_index); | ||
guarantee(alloc_buf->words_remaining() <= required_in_plab, "must be"); | ||
guarantee(words_remaining <= required_in_plab, "must be"); |
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.
What's the intend of this check? Also, if the two are equal, plab-alloc should have succeeded, so one shouldn't retire the current plab.
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.
This is a (pre-existing) sanity check (that is correct but a little imprecise because in the == case we would not reach here) and could (and probably should because it is somewhat confusing) be removed.
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 reviews @albertnetymk , @Hamlin-Li, and @tschatzl. /integrate |
Going to push as commit 47aa6f3.
Your commit was automatically rebased without conflicts. |
Hi all,
Please review this change to improve on how G1 deals with ParallelGCBufferWastePct. Currently, any allocations larger than ParallelGCBufferWastePct of the current PLAB size are allocated directly without regard for the state of the current PLAB. This creates a pathological case where fully used up PLAB are not retired given that allocation sizes larger than ParallelGCBufferWastePct current PLAB.
In this change, we directly check whether the current PLAB can be retired i.e. the remaining PLAB space is < ParallelGCBufferWastePct of current PLAB size. This should reduce the number of direct allocations.
Testing: - mach5 Tier 1-6
- No regression was observed on perf benchmarks
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15482/head:pull/15482
$ git checkout pull/15482
Update a local copy of the PR:
$ git checkout pull/15482
$ git pull https://git.openjdk.org/jdk.git pull/15482/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15482
View PR using the GUI difftool:
$ git pr show -t 15482
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15482.diff
Webrev
Link to Webrev Comment