Presentation is loading. Please wait.

Presentation is loading. Please wait.

A BORTING C ONFLICTING T RANSACTIONS IN AN STM PP O PP’09 2/17/2009 Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy.

Similar presentations


Presentation on theme: "A BORTING C ONFLICTING T RANSACTIONS IN AN STM PP O PP’09 2/17/2009 Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy."— Presentation transcript:

1 A BORTING C ONFLICTING T RANSACTIONS IN AN STM PP O PP’09 2/17/2009 Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy Brown University Committing

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 2 Contention LocksTM High Low

3 S TATE O F THE A RT M ITIGATES P ROBLEM 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 3

4 E XAMPLE OF C ONFLICTS Conflicting working sets : Our approach: No API changes Concepts clarified: Isolated != Conflict-free 4 A: atomic { //work counter += 10 } B: atomic { // work tmp = counter counter = tmp + 10 }

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

6 TM T ODAY IS C ONSERVATIVE 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” 6 Serializable Conflict Serializable 2PL

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

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

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

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

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

12 C ONFLICTS BECOME D EPENDENCES Dependence Graph Transactions: nodes dependences: edges edges dictate commit order no cycles  conflict serializable … write X write Y read Z … Tx B … read X write Y write Z … Tx A Tx B RWRW WWWW WRWR Read-Write: A commits before B Write-Write: A commits before B Write-Read: forward data overwrite  abort A commits before B 12

13 F ORMAL 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… 13

14 D EPENDENCE R EQUIREMENTS 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 14 Tx 2 Tx 1 Tx 3

15 DASTM P ROTOTYPES 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 15

16 DASTM P ROTOTYPES (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 ! 16

17 DASTM: E XPERIMENTAL S ETUP 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 17

18 DASTM-C: R ESULTS 18

19 C ONCLUSION 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 19


Download ppt "A BORTING C ONFLICTING T RANSACTIONS IN AN STM PP O PP’09 2/17/2009 Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy."

Similar presentations


Ads by Google