8280087: G1: Handle out-of-mark stack situations during reference processing more gracefully#4415
8280087: G1: Handle out-of-mark stack situations during reference processing more gracefully#4415zangcq wants to merge 5 commits into
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 |
|
@zangcq This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/4415/head:pull/4415$ git checkout pull/4415Update a local copy of the PR:
$ git checkout pull/4415$ git pull https://git.openjdk.org/jdk17u-dev.git pull/4415/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4415View PR using the GUI difftool:
$ git pr show -t 4415Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/4415.diff
Using Webrev
Link to Webrev Comment