RFR(M): 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon Nov 25 08:16:09 PST 2013


Hi,

I preprared a webrev with fixes for PPC for the VolatileIRIWTest of the torture test suite:
http://cr.openjdk.java.net/~goetz/webrevs/8029101-0-raw/

Example:
volatile x=0, y=0
  __________    __________    __________    __________
| Thread 0 |  | Thread 1 |  | Thread 2 |  | Thread 3 |

   write(x=1)    read(x)       write(y=1)    read(y)
                 read(y)                     read(x)

Disallowed:     x=1, y=0                    y=1, x=0


Solution: This example requires multiple-copy-atomicity. This is only
assured by the sync instruction and if it is executed in the threads
doing the loads. Thus we implement volatile read as sync-load-acquire
and omit the sync/MemBarVolatile after the volatile store.
MemBarVolatile happens to be implemented by sync.
We fix this in C2 and the cpp interpreter.

This addresses a similar issue as fix "8012144: multiple SIGSEGVs
fails on staxf" for taskqueue.hpp.

Further this change contains a fix that assures that volatile fields
written in constructors are visible before the reference gets
published.


Looking at the code, we found a MemBarRelease that to us, seems too strong.
We think in parse1.cpp do_exits() a MemBarStoreStore should suffice.
What do you think?

Please review and test this change.

Best regards,
  Goetz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20131125/7d67eacf/attachment.html 


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