Enhancing Permissiveness of Transactional Memory via Time-Warp Nuno Diegues and Paolo Romano ndiegues@gsd.inesc-id.pt INESC-ID/Instituto Superior T´ ecnico Nuno Diegues 1/17
Introduction Transactional Memory Simple API + guarantee of correctness criterion Easy to use and reason Nuno Diegues 2/17
A B Introduction To guarantee a given correctness level, a TM aborts transactions. Nuno Diegues 3/17
Introduction To guarantee a given correctness level, a TM aborts transactions. A r(z) B Nuno Diegues 3/17
Introduction To guarantee a given correctness level, a TM aborts transactions. w(z) A r(z) B Nuno Diegues 3/17
Introduction To guarantee a given correctness level, a TM aborts transactions. w(z) A r(z) B Nuno Diegues 3/17
Introduction To guarantee a given correctness level, a TM aborts transactions. w(z) A r(z) B Nuno Diegues 3/17
Introduction To guarantee a given correctness level, a TM aborts transactions. w(z) A r(z) B Nuno Diegues 3/17
Introduction To guarantee a given correctness level, a TM aborts transactions. w(z) A r(z) B Nuno Diegues 3/17
Introduction To guarantee a given correctness level, a TM aborts transactions. w(z) A r(z) B X Nuno Diegues 3/17
w(z) A r(z) B X Problem at hands But why are we aborting the transaction in the example? Nuno Diegues 4/17
Problem at hands But why are we aborting the transaction in the example? Instead, we could do the following: w(z) A r(z) B Serialization order: B , A Nuno Diegues 4/17
Problem at hands Condition: Abort T if its reads are not up-to-date when it attempts to commit. Nuno Diegues 5/17
Problem at hands Condition: Abort T if its reads are not up-to-date when it attempts to commit. Serializability: Necessary condition But not sufficient Nuno Diegues 5/17
Problem at hands Condition: Abort T if its reads are not up-to-date when it attempts to commit. Serializability: Necessary condition But not sufficient Deemed to be practical Nuno Diegues 5/17
Permissiveness Notion of avoiding unnecessary aborts Nuno Diegues 6/17
Permissiveness Notion of avoiding unnecessary aborts: If it only aborts a transaction when the resulting history (without the abort) does not respect some target correctness criterion Nuno Diegues 6/17
Permissiveness State of the art TMs far from being permissive. Nuno Diegues 7/17
Permissiveness State of the art TMs far from being permissive. Cost is not negligible. Nuno Diegues 7/17
Permissiveness State of the art TMs far from being permissive. Cost is not negligible. What do we have to counter that? One way is to track the graph of dependencies — DATM ◮ inconsistent reads and zombie transactions Nuno Diegues 7/17
Permissiveness State of the art TMs far from being permissive. Cost is not negligible. What do we have to counter that? One way is to track the graph of dependencies — DATM ◮ inconsistent reads and zombie transactions Maintain interval of possible serialization points — AVSTM ◮ Moderate bookkeeping ◮ Aborts read-only transactions Nuno Diegues 7/17
Goal Enhance permissiveness without such costs Nuno Diegues 8/17
Goal Enhance permissiveness without such costs: More restrictive abort condition Always read consistently Wait-free read-only transactions (mv-permissiveness) Nuno Diegues 8/17
Time-warping Allow transactions to commit in the past Nuno Diegues 9/17
Time-warping Allow transactions to commit in the past: Pick the condition defined previously ◮ Abort T if its reads are not up-to-date when it attempts to commit. Nuno Diegues 9/17
Time-warping Allow transactions to commit in the past: Pick the condition defined previously ◮ Abort T if its reads are not up-to-date when it attempts to commit. Commit T and serialize it before the writes it missed ◮ Time-warp commit Nuno Diegues 9/17
Time-warp w(z) A 1 Natural Commit: 1 w(x) r(z) B Natural Commit: 2 Same history as before Nuno Diegues 10/17
Time-warp w(z) A 1 Time-warp: 1 Natural Commit: 1 w(x) r(z) B Natural Commit: 2 Time-warp order Nuno Diegues 10/17
Time-warp w(z) A 1 Time-warp: 1 Natural Commit: 1 w(x) r(z) B Time-warp: 1 - Ɛ Natural Commit: 2 B time-warp commits Nuno Diegues 10/17
Time-warp When can we not apply this idea? Nuno Diegues 11/17
Time-warp When can we not apply this idea? Look out for a specific structure Nuno Diegues 11/17
Time-warp When can we not apply this idea? Look out for a specific structure: Three transactions connected — a triad Nuno Diegues 11/17
Time-warp When can we not apply this idea? Look out for a specific structure: Three transactions connected — a triad The link between all three — the pivot Nuno Diegues 11/17
Time-warp When can we not apply this idea? Look out for a specific structure: Three transactions connected — a triad The link between all three — the pivot Abort T if Nuno Diegues 11/17
Time-warp When can we not apply this idea? Look out for a specific structure: Three transactions connected — a triad The link between all three — the pivot Abort T if: ◮ Completes a triad Nuno Diegues 11/17
Time-warp When can we not apply this idea? Look out for a specific structure: Three transactions connected — a triad The link between all three — the pivot Abort T if: ◮ Completes a triad ◮ Whose pivot time-warp committed Nuno Diegues 11/17
Abort rule r(x) w(y) A C r(y) w(x) B C aborts here Nuno Diegues 12/17
Abort rule r(y) r(x) A w(y) C r(y) w(x) B (rather strict) necessary condition for a cycle Nuno Diegues 12/17
Theoretical and Practical results Serializability for committed transactions Nuno Diegues 13/17
Theoretical and Practical results Serializability for committed transactions Virtual World Consistency (stronger) for running transactions ◮ Prevent a range of phenomena to avoid sandboxing Nuno Diegues 13/17
Theoretical and Practical results Serializability for committed transactions Virtual World Consistency (stronger) for running transactions ◮ Prevent a range of phenomena to avoid sandboxing Lock-free prototype in Java Nuno Diegues 13/17
Theoretical and Practical results Serializability for committed transactions Virtual World Consistency (stronger) for running transactions ◮ Prevent a range of phenomena to avoid sandboxing Lock-free prototype in Java 48 core machine Nuno Diegues 13/17
Theoretical and Practical results Serializability for committed transactions Virtual World Consistency (stronger) for running transactions ◮ Prevent a range of phenomena to avoid sandboxing Lock-free prototype in Java 48 core machine Nuno Diegues 13/17
SkipList and Vacation from STAMP 5M JVSTM 4M TL2 throughput (txs/s) TWM 3M 2M 1M 1 5 10 15 20 25 30 35 40 45 20k 15k 10k 5k Nuno Diegues 1 5 10 15 20 25 30 35 40 45 14/17
SkipList and Vacation from STAMP 50 40 aborted txs (%) 5M JVSTM 4M TL2 30 throughput (txs/s) TWM 3M 20 2M 10 1M 0 1 5 10 15 20 25 30 35 40 45 1 5 10 15 20 25 30 35 40 45 100 80 60 20k 15k 40 10k 20 5k 0 1 5 10 15 20 25 30 35 40 45 1 5 10 15 20 25 30 35 40 45 Nuno Diegues 14/17
Ongoing work 1/2 Nuno Diegues 15/17
Ongoing work 1/2 Time-warp in a distributed transactional setting Nuno Diegues 15/17
Ongoing work 1/2 Time-warp in a distributed transactional setting: Generalizable to a variety of protocols Nuno Diegues 15/17
Ongoing work 1/2 Time-warp in a distributed transactional setting: Generalizable to a variety of protocols Partially replicated key-value store with transactions Nuno Diegues 15/17
Ongoing work 1/2 Time-warp in a distributed transactional setting: Generalizable to a variety of protocols Partially replicated key-value store with transactions Scalable solution ◮ Now also with update workloads Nuno Diegues 15/17
Ongoing work 2/2 Partially replicated large collections Scalable computations Transaction friendly despite structural conflicts Nuno Diegues 16/17
Thank you Nuno Diegues 17/17
Recommend
More recommend