RFR: 8370039: GenShen: array copy SATB barrier improvements

Kelvin Nilsen kdnilsen at openjdk.org
Mon Nov 10 21:58:02 UTC 2025


On Thu, 6 Nov 2025 20:52:11 GMT, William Kemper <wkemper at openjdk.org> wrote:

> When an array copy happens concurrently with old and young marking, Shenandoah's generational mode walks over the array twice. This is unnecessary and increases the workload for marking threads. It also has been unconditionally enqueuing old references during a young mark. This is also unnecessary and also increases marking workload. Finally, the barrier went through a somewhat complicated decision process based on affiliation of the region where the array resides. However, the barrier must consider the affiliation of objects that are pointed at by array elements.

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 413:

> 411:         }
> 412:         shenandoah_assert_forwarded_except(elem_ptr, obj, _heap->cancelled_gc());
> 413:         ShenandoahHeap::atomic_update_oop(fwd, elem_ptr, o);

Is the comment at the start of arraycopy_work() still relevant?  The description of the PR suggests that we will no longer call arraycopy_work() twice, but I'm not sure I fully understand the context of that statement.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28183#discussion_r2512087213


More information about the hotspot-gc-dev mailing list