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

SUN Guoyun duke at openjdk.org
Fri Jun 30 01:30:53 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

OK, thanks @TheRealIMDoerr for the confirm. This PR has performance advantages on LoongArch, because there are special StoreLoad instructions and full barrier instructions on LA, and the performance is different.

dbar 0x10 // Wait for earlier read-write (RW) operations complete before subsequent read-write (RW) operations
dbar 0x19 // Wait for earlier write (W) operations to complete before subsequent read (R) operations

Maybe I should write a performance test case for this PR.

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

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


More information about the hotspot-gc-dev mailing list