RFR: 8261492: Shenandoah: reconsider forwardee accesses memory ordering [v2]

Aleksey Shipilev shade at openjdk.java.net
Thu Feb 11 16:21:41 UTC 2021


On Thu, 11 Feb 2021 16:14:00 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> It is not about the mark word itself, we access the forwardee afterwards. It is about transitive dependency: object copy stores -> forwardee installation (markword store, release) -> forwardee discovery (markword load, acquire) --> object copy access. Remember this: https://github.com/openjdk/jdk/pull/2498#discussion_r574498830
>
> Sorry. I commented on wrong place. I actually meant line #78 in try_update_forwardee().

You have to do acquire there as well, because you can exit from the next block, the one with `old_mark.is_marked()`, never getting further. Then the whole thing unfolds: for transitive visibility of the object contents, you have to load the mark word with acquire before accessing forwardee contents.

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

PR: https://git.openjdk.java.net/jdk/pull/2496


More information about the shenandoah-dev mailing list