RFR: 8288904: Incorrect memory ordering in UL [v2]

Erik Österlund eosterlund at openjdk.org
Wed Jun 22 20:42:34 UTC 2022


On Wed, 22 Jun 2022 07:45:26 GMT, Johan Sjölén <duke at openjdk.org> wrote:

>> Please review this fix for JDK-8288904, thank you.
>> 
>> Passed tier1-tier3 tests, excluding faulty tests.
>
> Johan Sjölén has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Comment the loadstore

Talked to Johan and StefanK earlier today. In general this data structure is very poorly synchronized. Nodes are injected without release store even though there are concurrent readers, there is no fencing or atomics around basically any of the heads or next pointer accesses, despite reading and writing to them concurrently. Not sure how much of it we want to rewrite in this particular patch, but it does need major reworking I think. Maybe the most reasonable option is writing a new data structure entirely. Or maybe this is one of those times where having any form of readers writer lock would make this code way easier to reason about. We already mark where the reader vs writer sections are, but with unnecessarily relaxed and fragile synchronization for what it is.
We have other places where we really want a readers writer lock and end up inventing the wheel again.
Not sure if fixing this properly should be done in this patch or a follow up patch.

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

PR: https://git.openjdk.org/jdk/pull/9225


More information about the hotspot-runtime-dev mailing list