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
Enhancing Permissiveness of Transactional Memory via Time-Warp Nuno - - PowerPoint PPT Presentation
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
Nuno Diegues and Paolo Romano
ndiegues@gsd.inesc-id.pt INESC-ID/Instituto Superior T´ ecnico
Nuno Diegues 1/17
Simple API + guarantee of correctness criterion Easy to use and reason
Nuno Diegues 2/17
To guarantee a given correctness level, a TM aborts transactions.
Nuno Diegues 3/17
To guarantee a given correctness level, a TM aborts transactions.
r(z)
Nuno Diegues 3/17
To guarantee a given correctness level, a TM aborts transactions.
w(z)
r(z)
Nuno Diegues 3/17
To guarantee a given correctness level, a TM aborts transactions.
w(z)
r(z)
Nuno Diegues 3/17
To guarantee a given correctness level, a TM aborts transactions.
w(z)
r(z)
Nuno Diegues 3/17
To guarantee a given correctness level, a TM aborts transactions.
w(z)
r(z)
Nuno Diegues 3/17
To guarantee a given correctness level, a TM aborts transactions.
w(z)
r(z)
Nuno Diegues 3/17
To guarantee a given correctness level, a TM aborts transactions.
w(z)
r(z)
Nuno Diegues 3/17
But why are we aborting the transaction in the example?
w(z)
r(z)
Nuno Diegues 4/17
But why are we aborting the transaction in the example? Instead, we could do the following:
w(z)
r(z)
Serialization order: B, A
Nuno Diegues 4/17
Condition: Abort T if its reads are not up-to-date when it attempts to commit.
Nuno Diegues 5/17
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
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
Notion of avoiding unnecessary aborts
Nuno Diegues 6/17
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
State of the art TMs far from being permissive.
Nuno Diegues 7/17
State of the art TMs far from being permissive. Cost is not negligible.
Nuno Diegues 7/17
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
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
Enhance permissiveness without such costs
Nuno Diegues 8/17
Enhance permissiveness without such costs: More restrictive abort condition Always read consistently Wait-free read-only transactions (mv-permissiveness)
Nuno Diegues 8/17
Allow transactions to commit in the past
Nuno Diegues 9/17
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
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
w(z)
r(z) w(x)
Natural Commit: 1 Natural Commit: 2
Same history as before
Nuno Diegues 10/17
w(z)
Time-warp: 1
r(z) w(x)
Natural Commit: 1 Natural Commit: 2
Time-warp order
Nuno Diegues 10/17
w(z)
Time-warp: 1
r(z) w(x)
Natural Commit: 1 Natural Commit: 2 Time-warp: 1 - Ɛ
B time-warp commits
Nuno Diegues 10/17
When can we not apply this idea?
Nuno Diegues 11/17
When can we not apply this idea? Look out for a specific structure
Nuno Diegues 11/17
When can we not apply this idea? Look out for a specific structure: Three transactions connected — a triad
Nuno Diegues 11/17
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
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
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
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
w(y) r(x) r(y) w(x)
C aborts here
Nuno Diegues 12/17
w(y) r(x) r(y) w(x)
r(y)
(rather strict) necessary condition for a cycle
Nuno Diegues 12/17
Serializability for committed transactions
Nuno Diegues 13/17
Serializability for committed transactions Virtual World Consistency (stronger) for running transactions
◮ Prevent a range of phenomena to avoid sandboxing Nuno Diegues 13/17
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
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
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
1M 2M 3M 4M 5M 1 5 10 15 20 25 30 35 40 45
throughput (txs/s)
JVSTM TL2 TWM 5k 10k 15k 20k 1 5 10 15 20 25 30 35 40 45
Nuno Diegues 14/17
1M 2M 3M 4M 5M 1 5 10 15 20 25 30 35 40 45
throughput (txs/s)
JVSTM TL2 TWM
10 20 30 40 50 1 5 10 15 20 25 30 35 40 45
aborted txs (%)
5k 10k 15k 20k 1 5 10 15 20 25 30 35 40 45
20 40 60 80 100 1 5 10 15 20 25 30 35 40 45
Nuno Diegues 14/17
Nuno Diegues 15/17
Time-warp in a distributed transactional setting
Nuno Diegues 15/17
Time-warp in a distributed transactional setting: Generalizable to a variety of protocols
Nuno Diegues 15/17
Time-warp in a distributed transactional setting: Generalizable to a variety of protocols Partially replicated key-value store with transactions
Nuno Diegues 15/17
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
Partially replicated large collections Scalable computations Transaction friendly despite structural conflicts
Nuno Diegues 16/17
Nuno Diegues 17/17