RFR: 8373116: Genshen: arraycopy_work should be always done for arrays in old gen during young concurrent marking [v7]
Xiaolong Peng
xpeng at openjdk.org
Mon Dec 8 21:14:12 UTC 2025
On Mon, 8 Dec 2025 20:49:30 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 450:
>>
>>> 448: assert(_heap->is_concurrent_mark_in_progress(), "only during marking");
>>> 449: if (ShenandoahSATBBarrier) {
>>> 450: if (!_heap->marking_context()->allocated_after_mark_start(reinterpret_cast<HeapWord*>(dst)) ||
>>
>> Predicates:
>> A: heap->is_concurrent_young_mark_in_progress()
>> B: heap->is_concurrent_old_mark_in_progress()
>> C: heap->heap_region_containining(dst)->is_old()
>> D: !heap->marking_context()->allocated_after_mark_start(dst)
>>
>> I think the conditions under which we need to call arraycopy_work() are:
>> (A && C) || (A && D) || (B && C && D)
>> which could be written:
>> (A && (C || D)) || (B && C && D)
>>
>> As written, I think we are also calling arraycopy_work() under certain unnecessary conditions, such as:
>> (B && C)
>
> Wondering if the test for is_generational() could be captured in a template parameter. Each invocation that I find with grep already knows whether is_generational.
Thanks to make it so clear, I did similar evaluation and knew we will call arraycopy_work when (B && C) is true, but it shouldn't cause crash from OldGC, we will be more conservative in such case resulting in maybe more live objects.
I'll try to make the tests here more accurate in the PR.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28669#discussion_r2600146192
More information about the shenandoah-dev
mailing list