RFR: 8351091: Shenandoah: global marking context completeness is not accurately maintained [v4]

Y. Srinivas Ramakrishna ysr at openjdk.org
Thu Mar 6 22:57:09 UTC 2025


On Wed, 5 Mar 2025 21:58:03 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 1028:
>> 
>>> 1026: 
>>> 1027: #ifdef ASSERT
>>> 1028:     ShenandoahMarkingContext* const ctx = _heap->marking_context();
>> 
>> Why not this instead?
>> 
>>  ShenandoahMarkingContext* const ctx = _heap->marking_context(r);
>
> Technically there is only one global  marking context for Shenandoah, even in generational mode, passing the region to marking_context doesn't make any difference. 
> 
> But in the method `complete_marking_context(r)`, it checks if the affiliated generation has complete marking, it is a more convenient version of  `complete_marking_context(affiliation)`.

OK, yes, that makes sense. Why not then use both `ShenandoahHeap::[complete_]marking_context()` as synonyms for `ShehandoahHeap::active_generation()->[complete_]marking_context()`. See other related comments in this review round.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23886#discussion_r1984136546


More information about the shenandoah-dev mailing list