RFR: 8310939: [c1] The visibility of write-volatile requires membar_volatile instead of membar

Martin Doerr mdoerr at openjdk.org
Thu Jun 29 20:50:02 UTC 2023


On Tue, 27 Jun 2023 12:46:14 GMT, SUN Guoyun <duke at openjdk.org> wrote:

> For c1 now, a volatile write case:
> 
> membar_release // LoadStore | StoreStore
> write volatile
> membar
> 
> Just like c2, here `membar` should be defined `membar_volatile` clearly, then for risc-v, ppc and loongarch can use StoreLoad for `membar_volatile` for better performance.
> 
> Testing:
> GHA testing
> jtreg tier1-3 for loongarch64

This doesn't change anything for PPC64 for the following reasons:
1. `support_IRIW_for_not_multiple_copy_atomic_cpu` is true
2. StoreLoad = fence = sync = membar_volatile
I wonder if a performance improvement can be measured on any other platform. I guess StoreLoad is typically so slow that other orderings don't matter?

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

PR Comment: https://git.openjdk.org/jdk/pull/14677#issuecomment-1613789870


More information about the hotspot-dev mailing list