Withdrawn: 8267585: JavaThread::set_thread_state generally needs release semantics

David Holmes dholmes at openjdk.java.net
Fri Jul 30 03:50:38 UTC 2021


On Mon, 19 Jul 2021 11:57:43 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Please review this small change to try and tidy up some of the memory ordering issues around the use of  `JavaThread::set_thread_state()` and `JavaThread::thread_state()`.
> 
> - Added: `release_set_thread_state()` and `thread_state_acquire()`
> - Replaced use of storestore barrier before `set_thread_state()` with `release_set_thread_state()`
> - Added missing release semantics in  ` vm_perform_shutdown_actions()`
> - Changed uses of `thread_state()` prior to checking `walkable()` to use acquire semantics, to match the release semantics used after `make_walkable()`
> - Use Atomic load/store instead of plain accesses on `_thread_state`
> - Removed unnecessary casts in the use of the Atomic and OrderAccess API's.
> 
> This makes some of the semantics clearer and removes redundant barriers on PPC64 and Aarch64 in some cases.
> 
> I question whether acquire/release semantics are needed by default on PPC64/Aarch64. I couldn't find any discussion related to that decision. But I can see that reasoning about when they are, and are not needed is quite difficult. So I didn't try to change that.
> 
> Testing:
>  - tiers 1-4 builds (as sanity check for cast removal etc)
>  - GHA (in progress)
> 
> Thanks,
> David

This pull request has been closed without being integrated.

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

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


More information about the hotspot-runtime-dev mailing list