RFR: JDK-8314777: GenShen: Alias young and old marking bits to legacy Shenandoah marking bit in gc state

Kelvin Nilsen kdnilsen at openjdk.org
Tue Aug 22 19:41:47 UTC 2023


On Tue, 22 Aug 2023 17:52:11 GMT, Aleksey Shipilev <shade 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,

Changing this comment.

> 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`

Moving these to +ShenandoahVerify

-------------

PR Review Comment: https://git.openjdk.org/shenandoah/pull/309#discussion_r1302101067
PR Review Comment: https://git.openjdk.org/shenandoah/pull/309#discussion_r1302101326


More information about the shenandoah-dev mailing list