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

Dean Long dlong at openjdk.org
Mon Jul 24 22:12:52 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

Just to clarify, I was suggesting that the shared code should not try to impose which barriers, if any, are used by the cpu-specific implementation.  So a better name for `volatile_write_post_barrier` might have been `volatile_write_post_hook`, where the "volatile_write" part is because that's the logical operation the shared code is doing.  The implementation of the hook could be a barrier or even a no-op.

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

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


More information about the hotspot-gc-dev mailing list