1 / 19

Aborting Conflicting Transactions in a n STM PPoPP’09 2/17/2009

Committing. Aborting Conflicting Transactions in a n STM PPoPP’09 2/17/2009. Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy Brown University. TM and its discontents. Contention is a challenge for TM Performance suffers due to aborts/stalls

betrys
Télécharger la présentation

Aborting Conflicting Transactions in a n STM PPoPP’09 2/17/2009

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. Committing Aborting Conflicting Transactions in an STMPPoPP’09 2/17/2009 Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy Brown University

  2. TM and its discontents • Contention is a challenge for TM • Performance suffers due to aborts/stalls • Transactions become serialized, just like locks ! • Contention manifests as conflicts • Write-sharing (e.g. counters) • Structural, not semantic conflicts (e.g. lists) • Solutions often sacrifice TM advantages • Complicate programming model, weaken semantics

  3. State Of the Art Mitigates Problem • Conflict management • Karma, Polka, Kindergarten, Eruption, Polite, Timestamp, … [Scherer&Scott07] • API/programming model • Galois [Kulkarni07], Boosting [Herlihy08] • ANTs [Harris07] • Escape actions [Zilles06], Early release [Skare06] • Open nesting [Moss05] • Isolation • TSTM [Adyonat08], SI-STM [Riegel06] Dependence-Aware Transactional Memory (DATM): transparency AND performance

  4. Example of Conflicts • Conflicting working sets : • Our approach: No API changes • Concepts clarified: Isolated != Conflict-free B: atomic { // work tmp = counter counter = tmp + 10 } A: atomic { //work counter += 10 }

  5. DATM Improves Performance tc time serialized T1 xbegin conflict arbitrate xend Lazy (e.g. TCC) T2 xbegin xbegin xend overlapped retry T1 xbegin conflict arbitrate xend Eager (MetaTM,LogTM) T2 xbegin xbegin xend no retry! T1 xbegin conflict xend DATM T2 xbegin xend (Eager/Eager: Updates in-place, conflict detection at time of reference) (Lazy/Lazy: Updates buffered, conflict detection at commit time)

  6. Serializable TM Today is Conservative Conflict Serializable • Serializable schedule • Equivalent to some serial interleaving • Conflict-serializability (CS) • Order of conflicting operations is the same • Two phase locking serializability (2PL) • Growing phase: growing amount of mutual exclusion • Shrinking phase: release mutual exclusion • 2PL is ubiquitous • The DB way: “Deny all who request my lock” • The TM way: “Abort all who request my memory” 2PL

  7. TM Schedules Not serializable Serial 2PL serializable Conflict-serializable A: atomic { //work counter += 10 } B: atomic { //work tmp = counter counter = tmp + 10 } Not serializable (Neither equivalent to A,B nor to B,A)

  8. TM Schedules Not serializable Serial 2PL serializable Conflict-serializable A: atomic { //work counter += 10 } B: atomic { //work tmp = counter counter = tmp + 10 } Serial (A,B)

  9. TM Schedules Not serializable Serial 2PL serializable Conflict-serializable A: atomic { //work counter += 10 } B: atomic { //work can’t read counter finally allowed tmp = counter counter = tmp + 10 // more work } 2PL (equivalent to A,B)

  10. TM Schedules Not serializable Serial 2PL serializable Conflict-serializable A: atomic { //work counter += 10 } B: atomic { //work tmp = counter counter = tmp + 10 } Conflict-serializable (equivalent to A,B)

  11. TM Schedules Not serializable Serial 2PL serializable Conflict-serializable A: atomic { //work counter += 10 } B: atomic { //work tmp = counter counter = tmp + 10 } Fwd Value Track dep. How DATM is Conflict-serializable (equivalent to A,B)

  12. Conflicts become Dependences • Write-Read: • forward data • overwrite  abort • A commits before B Tx B Tx A … write X write Y read Z … … read X write Y write Z … Read-Write: A commits before B RW Write-Write: A commits before B Tx A Tx B WW WR • Dependence Graph • Transactions: nodes • dependences: edges • edges dictate commit order • no cycles  conflict serializable

  13. Formal model and proof • Safety: • Accepts only conflict-serializable schedules • Completeness • Accepts all conflict-serializable schedules • Key Idea • DATM tracks read/write dependences and aborts transactions only if cycles exist in the underlying serialization graph • Note: implementations can reject some schedules for variety of reasons (e.g. imprecise deadlock detection) • See paper for details…

  14. Dependence Requirements • Enforcing commit order • Wait for dependences to resolve • W R dependences • Forward data • Guarantee data is not stale • Handle cyclic dependences • Prevent • Detect and abort • Timeout • Tracking multiple versions of data • Beyond eager/lazy version management Tx 2 Tx 1 Tx 3

  15. DASTM Prototypes • DASTM-C • C, word-based • DASTM-J • Java, object-based • Global metadata table (a la TL2) • Require unique metadata structure per slice • Metadata contains • Multiple versions for each shared item • Forward/receive flags

  16. DASTM Prototypes (2) • Optimize read-only data • to avoid unnecessary dependences • Deadlock detection • Dreadlocks[Herlihy08] (DASTM-J) • Timeout (DASTM-C) • Vector-clocks to summarize dependences • Used only for commit order • Zombies are back !

  17. DASTM: Experimental Setup • Sun T1 (Niagara) multi-core system • 32 processing contexts (8 cores, 4 ctx/core) • Memory: private L1 / shared L2 • Linux 2.6.24 • Compare DASTM-C to TL2 • Measure speedup, from 1 to 32 threads • Benchmarks • Counter micro-benchmark • “think time” to simulate work • STAMP benchmarks • vacation – large transactions • ssca2 – small transactions

  18. DASTM-C: Results

  19. Conclusion • DATM turns conflicts into commits • Isolation != Conflict-free • Transparent to programmer • Doesn’t unnecessarily complicate TM API • DATM is proven safe • Prototypes demonstrate good performance

More Related