Title: Information-Flow Models for Shared Memory
1Information-Flow Models for Shared Memory
- Allon Adir
- Hagit Attiya
- Gil Shurek
2Program Example
Initial state All0
Prog1
Prog2
load(X, R1)
load(Y, R3)
R2 R1
R3 R3 1
R1 1
store(R1, Y)
store(R3, X)
Final state R22 ?
3Program Example
Initial state All0
Prog1
Prog2
load(X, R1)
load(Y, R3)
R2 R1
R3 R3 1
R1 1
store(R1, Y)
store(R3, X)
Final state YR11, XR2R32
4PowerPC Consistency
Initial state All0
Prog1
Prog2
load(X, R1)
load(Y, R3)
R2 R1
R3 R3 1
R1 1
store(R1, Y)
store(R3, X)
Final state YR11, XR2R32
5Shared-Memory Semantics
- Capturing intricate shared-memory behaviors
- Speculation
- Out-of-Order Execution
- Synchronization
- Granularity of Memory Accesses
- Without revealing micro-architecture details
6Outline
- What is an Architecture?
- What is a Computation Model?
- The Framework
- Sequential Consistency
- PowerPC Consistency
7What is an "Architecture"?
8Elements of an Architecture
- Resources
- Granules
- States
- Instructions
- Formats
- Operands
- Source/Target
- Addressing-Mode
- State Transformation
9Elements of an Architecture
10Computation Model
- Can we reach final state s2 by running a program
Prog from initial state s1? - Written as
- Is ás1, s2, Progñ possible?
11Example Sequential Consistency
Initial state R1R2X0
Prog1 Prog2 store(R2, X) R11
R22 store(R1, X) store(R2, X)
Final state R11, R22, X0
X1 X2
12The Framework
- Instruction instances Text order
- Flow-of-Information
Text Order
branch
store
cmp
nand
store
mul
load
load
xor
Is the flow-of-information allowed by the model?
13The Elements
- Resource X,R
- Assignment resource-value pair (X,5)
- Operation in-out pair
((X,5),(R,5)) - Instruction ((X,0),(R,0)),
((X,1),(R,1)), ... - Program sequence of commands C1,...,Cm
- Command an instruction B and a function
- next B 1..mÈ
14Program Order Example
Prog Instantiating Prog
C1 load(X,R1) C2 R3 R1R2 next(C1)2 next(C2
)
op1 ((X,1),(R1,1)) op2 ((R1,1),(R2,1),
(R3,2)) s1 (X,1), (R1,1), (R2,1),
(R3,1) s2 (X,1), (R1,1), (R2,1), (R3,2)
Program order s1 op1 op2 s2
15Reads-From Mapping f
R2
s1 All1 load(X,R1) R3 R1R2 s2 R32,
others1
R1
16Reads-From Mapping f
R2, X
R2
s1 All1 load(X,R1) R3 R1R2 s2 R32,
others1
R1
R1
R3
17The Reads-From Mapping is not Cyclic
18View orders lt
- Order the operations in Prog
- One for each Progi
- Obey architecture-specific rules relating
- program-order
- reads-from mapping
19Sequential Execution
Information can not be read from the hidden past
I(X)
f(x)
op5
O(X)
lt
lt
lt
lt
op2
s2
op1
s1
op4
op3
20Sequential Execution
Information can not be read from the future
f
op5
lt
lt
lt
lt
op2
s2
op1
s1
op4
op3
Relative to which order?
21Sequential Consistency
- áS1,S2,Progñ is sequentially consistent if
- Prog can be instantiated with a set of
operations A and program order - A single view order
- linear
- extends the program order
- Information flow satisfies the sequential
- execution conditions relative to view order
22PowerPC Consistency
- Information flow satisfies the sequential
execution conditions - Relative to program order
- Relative to view orders
23PowerPC Consistency View Orders
- View orders enforce that
- Memory is coherent, except for local stores.
- Shared resource dependencies are preserved.
- sync orders operations around it.
- sync is transitive (sort of).
- Branch dependencies are preserved.
24PowerPC Consistency View Orders I
25PowerPC Consistency View Orders II
26Speculation is Visible to Programs
Final state XY1 R11,R20 R31,R40