RFR(M): 8155949: Support relaxed semantics in cmpxchg

Kim Barrett kim.barrett at oracle.com
Thu May 19 22:03:02 UTC 2016


> On May 18, 2016, at 6:12 AM, Doerr, Martin <martin.doerr at sap.com> wrote:
> 
> Hi Kim,
> 
> thank you very much for the detailed review.
> 
> I agree with your comments and I have made all your requested changes here:
> http://cr.openjdk.java.net/~goetz/wr16/8155949-relaxed_cas/webrev.03/
> 
> It's correct that the change changes the semantics of the conservative cmpxchg. In case of failure, we also execute the sync instruction, now.
> Advantage is that the new implementation is maximum conservative by default. I think this makes sense as long as the semantics of the hotspot C++ cmpxchg are not clearly specified.
> 
> For performance optimization, we should better use (or introduce additional) enum values.

------------------------------------------------------------------------------  
There doesn't seem to have been any change for this earlier comment.

src/share/vm/runtime/atomic.cpp
59 unsigned Atomic::cmpxchg(unsigned int exchange_value,
 60                            volatile unsigned int* dest, unsigned int compare_value,
 61                            cmpxchg_memory_order order) {

I'm surprised this was ever out-of-line. But with this change it's
quite bad to be out-of-line, as that's going to kill the constant
propogation of the order value.

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

Other than that, looks good.






More information about the ppc-aix-port-dev mailing list