RFR: 8351091: Shenandoah: global marking context completeness is not accurately maintained
Xiaolong Peng
xpeng at openjdk.org
Tue Mar 4 21:26:03 UTC 2025
With the JEP 404: Generational Shenandoah implementation, there are generation specific marking completeness flags introduced, and the global marking context completeness flag is not updated at all after initialization, hence the global marking context completeness is not accurate anymore. This may cause expected behavior: [ShenandoahHeap::complete_marking_context()](https://github.com/openjdk/jdk/pull/23886/files#diff-d5ddf298c36b1c91bf33f9bff7bedcc063074edd68c298817f1fdf39d2ed970fL642) should throw assert error if the global marking context completeness flag is false, but now it always return the marking context even it marking is not complete, this may hide bugs where we expect the global/generational marking to be completed.
This change PR fix the bug in global marking context completeness flag, and update all the places using `ShenandoahHeap::complete_marking_context()` to use proper API.
### Test
- [x] hotspot_gc_shenandoah
- [x] Tier 1
- [ ] Tier 2
-------------
Commit messages:
- Revert unnecessary changes in ShenandoahReferenceProcessor
- Revert the change in ShenandoahHeap::generation_for
- touch up
- If GC generation is young and referent is in old, make should_drop return false if old gen marking is not complete
- Remove ShenandoahHeap::complete_marking_context()
- Fix improper use of heap->complete_marking_context()
- promotion in place and reference processor should be aware of heap generation when use complete marking context
- JDK-8351091: initial works
Changes: https://git.openjdk.org/jdk/pull/23886/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23886&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8351091
Stats: 61 lines in 17 files changed: 9 ins; 23 del; 29 mod
Patch: https://git.openjdk.org/jdk/pull/23886.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23886/head:pull/23886
PR: https://git.openjdk.org/jdk/pull/23886
More information about the shenandoah-dev
mailing list