RFR: 8261492: Shenandoah: reconsider forwardee accesses memory ordering [v2]
Zhengyu Gu
zgu at openjdk.java.net
Thu Feb 11 16:21:40 UTC 2021
On Thu, 11 Feb 2021 16:06:37 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahForwarding.inline.hpp line 89:
>>
>>> 87: // (would be paired with acquire in forwardee accessors). Acquire on failed update
>>> 88: // would get the updated object after the forwardee load.
>>> 89: markWord prev_mark = obj->cas_set_mark(new_mark, old_mark, memory_order_acq_rel);
>>
>> Same here, CAS guarantees you to see latest mark word. memory_order_release should be sufficient here, paired with memory_order_acquire in resolve_forward barrier to ensure safe publishing the new object.
>
> Again, not really about the mark word. The transitive load of the object from that fwdptr is what we are after.
I kind of seeing what you meant, if there is a load after, we do need acquire. So good to me.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2496
More information about the shenandoah-dev
mailing list