RFR: JDK-8314777: GenShen: Alias young and old marking bits to legacy Shenandoah marking bit in gc state
Aleksey Shipilev
shade at openjdk.org
Tue Aug 22 18:31:22 UTC 2023
On Tue, 22 Aug 2023 00:10:42 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
> This change sets the MARKING bit of _gc_state whenever either Young marking or Old marking is active. With this change, barrier code more closely resembles the code in the original single-generation Shenandoah. The performance impact is negligible. The primary benefit is to simplify code reviews and clarify that the addition of generational mode to Shenandoah does not negatively impact performance of single-generation Shenandoah.
src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 317:
> 315: HAS_FORWARDED_BITPOS = 0,
> 316:
> 317: // Young or OLD regions are under marking: needs SATB barriers.
To match upstream better, it would be proper to do:
// Heap is under marking: needs SATB barriers.
// For generational mode, it means either young or old marking, or both.
MARKING_BITPOS = 1,
src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 665:
> 663: assert((_gc_state.is_unset(MARKING) && _gc_state.is_unset(YOUNG_MARKING) && _gc_state.is_unset(OLD_MARKING)) ||
> 664: (_gc_state.is_set(MARKING) && (_gc_state.is_set(YOUNG_MARKING) || _gc_state.is_set(OLD_MARKING))),
> 665: "Inconsistent gc marking state");
I think the proper place for checks like these are in `ShenandoahVerifier::verify_at_safepoint`
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/309#discussion_r1301996305
PR Review Comment: https://git.openjdk.org/shenandoah/pull/309#discussion_r1302004828
More information about the shenandoah-dev
mailing list