Prepared by: | goetz on Wed Jan 15 16:25:27 CET 2014 |
---|---|
Workspace: | /net/usr.work/d045726/oJ/raw-2-stage-hotspot |
Compare against: | http://hg.openjdk.java.net/ppc-aix-port/stage/hotspot |
Compare against version: | 5810 |
Summary of changes: | 66 lines changed: 62 ins; 0 del; 4 mod; 14747 unchg |
Changeset: | raw-2-stage-hotspot.changeset |
Author comments: | Implementation of memory ordering for volatile/unsafe accesses. This supports ordering of "Independent Reads of Independent Writes" as tested by VolatileIRIWTest of the torture test suite:
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. (See "A Tutorial Introduction to the ARM and POWER Relaxed Memory Models" by Luc Maranget, Susmit Sarkar and Peter Sewell, INRIA/Cambridge.) This is only assured by the sync instruction and if it is executed in the thread doing the load. Thus we implement volatile read as sync-load-acquire and omit the sync/MemBarVolatile after the volatile store. MemBarVolatile is implemented by sync on PPC. This addresses a similar issue as fix "8012144: multiple SIGSEGVs fails on staxf" for taskqueue.hpp. On PPC, the MemBarVolatile after volatile stores does in addition to the required store-load barrier a store-store barier. This is because MemBarVolatile is implemented as sync inctruction which does all four barriers in one instruction. Because of this, initialization of volatile variables is no more assured to happen before the initialized object gets visible. To assure this, we add the MemBarVolatile again at the end of constructors. 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. |
Legend: |
Modified file Deleted file New file |
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/cpu/ppc/vm/globalDefinitions_ppc.hpp
rev 5811 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes Contributed-by: mdoerr7 lines changed: 7 ins; 0 del; 0 mod; 40 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/interpreter/bytecodeInterpreter.cpp
rev 5811 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes Contributed-by: mdoerr5 lines changed: 5 ins; 0 del; 0 mod; 3489 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/library_call.cpp
rev 5811 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes Contributed-by: mdoerr14 lines changed: 11 ins; 0 del; 3 mod; 6100 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/parse.hpp
rev 5811 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes Contributed-by: mdoerr5 lines changed: 5 ins; 0 del; 0 mod; 624 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/parse1.cpp
rev 5811 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes Contributed-by: mdoerr12 lines changed: 11 ins; 0 del; 1 mod; 2192 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/parse3.cpp
rev 5811 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes Contributed-by: mdoerr14 lines changed: 14 ins; 0 del; 0 mod; 550 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/prims/unsafe.cpp
rev 5811 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes Contributed-by: mdoerr9 lines changed: 9 ins; 0 del; 0 mod; 1752 unchg
This code review page was prepared using /sapmnt/home1/d045726/bin/webrev.ksh (vers 24.0-hg+jbs).