RFR: 8336944: Shenandoah: Should only relativize stack chunks for successful evacuations
William Kemper
wkemper at openjdk.org
Tue Jul 23 15:19:34 UTC 2024
On Tue, 23 Jul 2024 12:06:26 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> In some cases, different threads may race to evacuate an object. The race is won by "CAS"ing in the forwarding pointer. The threads that lose this race must "back out" their allocation. The work to relativize stack chunks should only happen for the thread that wins the evacuation race.
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 1185:
>
>> 1183: // Successfully evacuated. Our copy is now the public one!
>> 1184: shenandoah_assert_correct(nullptr, copy_val);
>> 1185: ContinuationGCSupport::relativize_stack_chunk(copy_val);
>
> Please move it before the assert, so that we are sure relativization did not foobar the `copy_val`. Asserts in these methods verify that we return good things.
Okay, I had it that way originally, but then changed it to make sure we were relativizing a valid copy.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20288#discussion_r1688249719
More information about the hotspot-gc-dev
mailing list