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

Xiaolong Peng xpeng at openjdk.org
Wed Mar 5 22:02:02 UTC 2025


On Wed, 5 Mar 2025 01:33:26 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Xiaolong Peng has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Remove obsolete code comments
>>  - Address review comments
>
> 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)`.

> src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp line 88:
> 
>> 86:   bool is_bitmap_range_within_region_clear(const HeapWord* start, const HeapWord* end) const;
>> 87: 
>> 88:   bool is_complete();
> 
> Add a 1-line documentation comment for this method.

is_complete is not used in any place, I removed it in the new version.

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

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


More information about the shenandoah-dev mailing list