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

Aleksey Shipilev shade at openjdk.org
Wed Jun 28 10:26:08 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

We need to be really careful about this, because we had the issues with inconsistent barrier schemes in C1 and C2:
https://bugs.openjdk.org/browse/JDK-8179954

Modern jcstress is able to run tests with one side compiled by C1 and another one compiled by C2, exactly to catch these things. So I suggest you get at least one clean jcstress run with this patch, at least on AArch64 (with both `-UseLSE` and `+UseLSE`).

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

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


More information about the hotspot-dev mailing list