RFR: 8340796: Use a consistent order when loading cxq and EntryList

Fredrik Bredberg fbredberg at openjdk.org
Thu Oct 24 15:58:05 UTC 2024


On Sat, 19 Oct 2024 01:01:21 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Made sure we use a consistent order when reading ObjectMonitor EntryList and cxq while exiting the monitor.
>> That consistent order is EntryList before cxq. Added a comment in the shared code to explaining why it's okay that waiters slip undetected between reading EntryList and cxq.
>> 
>> Tested ok tier1-3.
>
> We don't have a LoadLoad on aarch64 to enforce the ordering, so isn't it more correct to say that the code handles either ordering correctly, and leave x86 the way it was?

@dean-long 
> We don't have a LoadLoad on aarch64 to enforce the ordering, so isn't it more correct to say that the code handles either ordering correctly, and leave x86 the way it was?

Both you and David was on to the same thing, so I decided to rewrite as per David's suggestion. However I will change the x86 code so it will follow the same order as the rest, just to avoid any head scratching about why x86 is done differently.

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

PR Comment: https://git.openjdk.org/jdk/pull/21584#issuecomment-2435671276


More information about the hotspot-dev mailing list