Skip to content

8383807: Parallel: Improve Young GC stack trimming#31024

Open
albertnetymk wants to merge 1 commit intoopenjdk:masterfrom
albertnetymk:pgc-trim-stack
Open

8383807: Parallel: Improve Young GC stack trimming#31024
albertnetymk wants to merge 1 commit intoopenjdk:masterfrom
albertnetymk:pgc-trim-stack

Conversation

@albertnetymk
Copy link
Copy Markdown
Member

@albertnetymk albertnetymk commented May 4, 2026

Improve Parallel GC promotion stack trimming for the single-GC-worker case.

Previously, PSPromotionManager used a drain target of 0 when ParallelGCThreads == 1, so intermediate stack-processing points fully drained the promotion stack. Full draining is expensive and unnecessary there; the stack only needs bounded trimming, with explicit full drains kept at termination points.

This change separates bounded trimming from full draining:

  • trim_stacks() trims to GCDrainStackTargetSize
  • drain_stacks() fully drains the stack

Running the attachment in JBS shows ~8% improvement for the -XX:ParallelGCThreads=1 case, and perf-neutral for multiple gc threads case.

Test: tier1



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8383807: Parallel: Improve Young GC stack trimming (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31024

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 4, 2026

👋 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
Copy Markdown

openjdk Bot commented May 4, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the hotspot-gc hotspot-gc-dev@openjdk.org label May 4, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 4, 2026

@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
Copy link
Copy Markdown

openjdk Bot commented May 4, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-gc. This can be overridden with the /reviewers command.

@albertnetymk albertnetymk changed the title pgc-trim-stack 8383807 May 4, 2026
@openjdk openjdk Bot changed the title 8383807 8383807: Parallel: Improve Young GC stack trimming May 4, 2026
@openjdk openjdk Bot added the rfr Pull request is ready for review label May 4, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 4, 2026

Webrevs

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 rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant