8280087: G1: Handle out-of-mark stack situations during reference processing more gracefully#4261
Open
zangcq wants to merge 4 commits intoopenjdk:masterfrom
Open
8280087: G1: Handle out-of-mark stack situations during reference processing more gracefully#4261zangcq wants to merge 4 commits intoopenjdk:masterfrom
zangcq wants to merge 4 commits intoopenjdk:masterfrom
Conversation
This change backports the dependency fix from OpenJDK commit f09a0f5ca787e139f240a33bb12491792b8e7003 to rename Atomic::fetch_and_add to Atomic::fetch_then_add across the codebase. This is a prerequisite dependency for the G1 mark stack overflow fix (8280087). The renaming provides better semantic clarity for atomic operations: - fetch_then_add: atomically adds value and returns the old value - add_then_fetch: atomically adds value and returns the new value Key changes: - Renamed all occurrences of fetch_and_add to fetch_then_add in 36 files - Updated function declarations and implementations in atomic.hpp - Updated platform-specific atomic implementations - Updated all callers in GC subsystems (G1, Parallel, Shenandoah, ZGC) - Updated test cases to use the new naming convention This change maintains full backward compatibility and does not affect the functionality of atomic operations, only their naming. Reviewed-by: stefank, dholmes Original-commit: f09a0f5ca787e139f240a33bb12491792b8e7003
…cessing more gracefully This change backports the fix from OpenJDK commit f696796e888d62535e6c864ce6fdf912eef0c3ed to improve G1's handling of mark stack overflow situations during reference processing. Key changes: - Refactored G1CMMarkStack to use a new ChunkAllocator class - Implemented growable array data structure for better memory management - Added set_should_grow() mechanism to prefer stack expansion during reference processing - Removed old resize-based approach in favor of dynamic chunk allocation - Added TestMarkStackOverflow.java test case The fix allows the G1 mark stack to grow more gracefully during reference processing phases, reducing the likelihood of overflow conditions that could cause marking restarts or VM exits. Reviewed-by: tschatzl, ayang Original-commit: f696796e888d62535e6c864ce6fdf912eef0c3ed
|
👋 Welcome back zangcq! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with the original issue, but not the original commit. If you have the original commit hash, please update the pull request title with |
Webrevs
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I want backport JDK-8280087 to fix g1 markstack not expand problem. but this patch depend JDK-8307806 , so I want port this two patch together
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/4261/head:pull/4261$ git checkout pull/4261Update a local copy of the PR:
$ git checkout pull/4261$ git pull https://git.openjdk.org/jdk17u-dev.git pull/4261/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4261View PR using the GUI difftool:
$ git pr show -t 4261Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/4261.diff
Using Webrev
Link to Webrev Comment