Presentation is loading. Please wait.

Presentation is loading. Please wait.

Complexity Implications of Memory Models. Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit.

Similar presentations


Presentation on theme: "Complexity Implications of Memory Models. Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit."— Presentation transcript:

1 Complexity Implications of Memory Models

2 Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit AttiyaDagstuhl // January 20152

3 Memory Models Abstract conditions on the way the reordering buffer is managed E.g., TSO does not allow reordering of stores PSO does not allow reordering of stores to the same location Dagstuhl // January 2015Hagit Attiya3 sequential consistency total store ordering (TSO) partial store ordering (PSO) relaxed memory ordering (RMO)

4 One fence is necessary Holds for concurrent data types with non- commutative operations (queues, counters…) Attiya, Guerraoui, Hendler, Kuznetsov, Michael, Vechev: Laws of order: expensive synchronization in concurrent algorithms cannot be eliminated. POPL 2011 A mutex algorithm must have a fence (unless it has an atomic operation) Hagit AttiyaDagstuhl // January 20154

5 Bakery algorithm needs O(1) fences But O(n) reads, and they are remote – Accesses served from cache: “free” – Remote Memory References (RMRs): “expensive” Not All Memory Accesses are Equal Shared memory processes operation buffer cache interconnect Hagit AttiyaDagstuhl // January 20155

6 Tournament-tree: entry section store Hagit AttiyaDagstuhl // January 20156

7 Tournament-tree: entry section store Hagit AttiyaDagstuhl // January 20157

8 Tournament-tree: entry section Hagit AttiyaDagstuhl // January 20158

9 Can We Optimize Fences and RMRs? E.g., with PSO, O(1) fences implies O(n) RMRs fencesRMRs Θ(log n) Tournament [Yang, Anderson] O(1)Θ(n)Bakery [Lamport] Without store reordering Θ(log n) O(1) With store reordering NO NO Hagit AttiyaDagstuhl // January 20159 Attiya, Hendler, Levy: An O(1)-barriers optimal RMRs mutual exclusion algorithm. PODC 2013

10 Write Fewer Fences? Make the tree more shallow by increasing the branching factor Hagit AttiyaDagstuhl // January 201510

11 How Shallow? Hagit AttiyaDagstuhl // January 201511 Make the tree more shallow by increasing the branching factor

12 Tradeoff, for every f = 1, …, log n Make the tree more shallow by increasing the fanout… Hagit AttiyaDagstuhl // January 201512 This is optimal

13 Lower Bound on the Tradeoff with Store Reordering Hagit AttiyaDagstuhl // January 201513

14 Wrap-Up Separation below TSO More accurate models for shared-memory multiprocessors – E.g., # fences Relate to semantic properties of implemented objects & operations Dagstuhl // January 2015Hagit Attiya14 sequential consistency total store ordering (TSO) partial store ordering (PSO) relaxed memory ordering (RMO)

15 Hagit AttiyaDagstuhl // January 201515

16 Outline of the Tradeoff LB Proof Backup Slides Dagstuhl // January 2015Hagit Attiya16

17 Proof Strategy I RADICONJuly 201417

18 Proof Strategy II RADICONJuly 201418

19 Proof Strategy III RADICONJuly 201419

20 The Encoding: Main Idea For each fence, handle writes with O(1) commands: – Wait for earlier processes to cover my writes – Wait for earlier processes to finish before my writes – Proceed Easy with a list of processes to wait for – But too lengthy  Write their number, and figure out their id’s when decoding July 2014RADICON20


Download ppt "Complexity Implications of Memory Models. Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit."

Similar presentations


Ads by Google