RFR (S) 8222766: Shenandoah: streamline post-LRB CAS barrier

Roman Kennke rkennke at redhat.com
Tue Apr 23 09:10:41 UTC 2019


Wait a second. We had this problem before: there *can* be from-space 
stores. Object-arraycopy can store from-space refs. It would only be 
temporary, because post-arraycopy would fix it, but I suspect that it 
can mess up the CAS. Right?

I do have a patch that turns the arraycopy pre/copy/post sequence into a 
single arraycopy loop, that does indeed only ever store to-space refs. 
Maybe worth to finish it?

Also, this is not really related to LRB. It would work just the same 
pre-LRB.

Roman

> RFE:
>    https://bugs.openjdk.java.net/browse/JDK-8222766
> 
> Webrev:
>    http://cr.openjdk.java.net/~shade/8222766/webrev.02/
> 
> Now that LRB switched Shenandoah to strong to-space invariant, we don't need the retry loop in CAS
> barrier. Instead, we can "just" fixup the memory pointer before retrying. Added more comments to
> explain how that works. Also, AArch64 snippet was synced up with x86_64 version, and switched to
> "macro" cmpxchg, which gives us cmpxchg instructions when LSE is enabled.
> 
> Testing: Linux {x86_64, aarch64}: hotspot_gc_shenandoah, full jcstress
> 



More information about the hotspot-gc-dev mailing list