1 / 28

Memory Consistency

Memory Consistency. Arbob Ahmad, Henry DeYoung, Rakesh Iyer 15-740/18-740: Recent Research in Architecture October 14, 2009. “Memory Model = Instruction Reordering + Store Atomicity” Arvind and Jan-Willem Maessen.

damon
Télécharger la présentation

Memory Consistency

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Memory Consistency Arbob Ahmad, Henry DeYoung, Rakesh Iyer 15-740/18-740: Recent Research in ArchitectureOctober 14, 2009

  2. “Memory Model =Instruction Reordering + Store Atomicity”Arvind and Jan-Willem Maessen “Memory consistency models exist to describeand constrain the behavior of [memory systems]” Gives a unifying framework forSC and relaxed models with an atomic memory

  3. Instruction Reorderingvs. Store Atomicity Instruction reordering rules: Consistency within a thread e.g.: Store atomicity rules: Ordering which must exist in every serialization Consistency across threads

  4. Store Atomicity Predecessor Stores of a Load are ordered before its source. x ← 1 x ← 2x → 2

  5. Store Atomicity Predecessor Stores of a Load are ordered before its source. Successor Stores of a Store are ordered after its observers. x ← 2x → 2 x ← 1

  6. Store Atomicity Predecessor Stores of a Load are ordered before its source. Successor Stores of a Store are ordered after its observers. Mutual ancestors of Loads are ordered before the mutual successors of the distinct Stores they observe. ?

  7. Thread A Thread B Thread C Local ordering constraints y ← 4Fence z → 6 Fence x ← 8 x → ? y ← 2Fence z ← 6 x ← 1Fence y → 2y → 4

  8. Thread A Thread B Thread C Observation constraints y ← 4Fence z → 6 Fence x ← 8 x → ? y ← 2Fence z ← 6 x ← 1Fence y → 2y → 4

  9. Thread A Thread B Thread C Question:Are there any ordering constraints not represented? y ← 4Fence z → 6 Fence x ← 8 x → ? y ← 2Fence z ← 6 x ← 1Fence y → 2y → 4

  10. Thread A Thread B Thread C Question:Are there any ordering constraints not represented? Order is y ← 2 : y → 2 : y ← 4 : y → 4 y ← 4 : y → 4 : y ← 2 : y → 2 or y ← 4Fence z → 6 Fence x ← 8 x → ? y ← 2Fence z ← 6 x ← 1Fence y → 2y → 4

  11. Thread A Thread B Thread C Order is y ← 2 : y → 2 : y ← 4 : y → 4 y ← 4 : y → 4 : y ← 2 : y → 2 or • x ← 1 must precede both y → 2 and y → 4 • z → 6 must followboth • y → 2 and y → 4 y ← 4Fence z → 6 Fence x ← 8 x → ? y ← 2Fence z ← 6 x ← 1Fence y → 2y → 4

  12. Thread A Thread B Thread C Store atomicity constraint y ← 4Fence z → 6 Fence x ← 8 x → ? y ← 2Fence z ← 6 x ← 1Fence y → 2y → 4

  13. Sequential Consistency Programmer's gold standard Question: How can we have the clarity of SC without sacrificing performance?

  14. Improving the Performance of SC Key Idea:Rather than turning the switch at individual memory access boundaries, do it only at chunk boundaries.

  15. This is the topic of:“BulkSC: Bulk Enforcement of Sequential Consistency”Luis Ceze, James Tuck, Pablo Montesinos, and Josep Torrellas“Mechanisms for Store-wait-free Multiprocessors”Thomas Wenisch, Anastasia Ailamaki, Babak Falsafi, and Andreas Moshovos

  16. Coarse Grain Enforcement of SC Similar to tasks in TLS and transactions in TM But, chunks are created dynamically by hardware;tasks and transactions are specified statically in code

  17. Common Ground • Dynamically divide the program into ‘chunks’ or ‘atomic sequences’ • ASO begins an atomic sequence when an ordering constraint would stall instruction retirement. • BulkSC assumes chunks are around 1000 instructions. • Re-ordering allowed within chunks/atomic sequences. • Updates not visible until the commit. • Evaluated on a full system simulator (Simics/Flexus)

  18. Bulk SC: Bulk Enforcement of Sequential Consistency Computes minimum serialization requirement. Enables BulkSC on machines without broadcast capabilites Chunk executes, updates L1 Commit Made, R,W Signatures broadcast Bulk Disambiguator computes intersection - Restart computation if non empty

  19. Atomic Store Ordering • Scalable Store Buffer • Eliminates store buffer capacity related stalls. • No associative lookup required. • ASO Implementation • Eliminates ordering related stalls. • Atomic sequence tracking. • Detecting atomicity violations. • Rollback on violation. • Commit atomic sequences.

  20. Performance Results Bulk SC ASO More realistic workloads

  21. Open Research Questions in Memory Consistency Memory model framework was descriptive. What are the prescriptive consequences? Can the “big-step” semantics of transactions be explained with “small-step” framework? Can the same hardware in a single system be used for all of coarse-grain SC, TLS, and TM? ...

  22. Thank you!

  23. Extra Slides

  24. x ← 1Fencey ← 2y → 3 y ← 3Fencex ← 4x → ? Thread A Thread B Local ordering constraints

  25. x ← 1Fencey ← 2y → 3 y ← 3Fencex ← 4x → ? Thread A Thread B Observation constraint

  26. x ← 1Fencey ← 2y → 3 y ← 3Fencex ← 4x → ? Thread A Thread B Question:We need one more edge to capture the ordering. Where should it go?

  27. Moral: When a store is observed to have been overwritten, the stores must be ordered. Thread A Thread B Store atomicity constraint

More Related