Enhancing Permissiveness of Transactional Memory via Time-Warp Nuno - - PowerPoint PPT Presentation

enhancing permissiveness of transactional memory via time
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

Introduction

Transactional Memory

Simple API + guarantee of correctness criterion Easy to use and reason

Nuno Diegues 2/17

slide-3
SLIDE 3

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B A

Nuno Diegues 3/17

slide-4
SLIDE 4

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B A

r(z)

Nuno Diegues 3/17

slide-5
SLIDE 5

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B

w(z)

A

r(z)

Nuno Diegues 3/17

slide-6
SLIDE 6

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B

w(z)

A

r(z)

Nuno Diegues 3/17

slide-7
SLIDE 7

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B

w(z)

A

r(z)

Nuno Diegues 3/17

slide-8
SLIDE 8

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B

w(z)

A

r(z)

Nuno Diegues 3/17

slide-9
SLIDE 9

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B

w(z)

A

r(z)

Nuno Diegues 3/17

slide-10
SLIDE 10

Introduction

To guarantee a given correctness level, a TM aborts transactions.

B

w(z)

A

r(z)

X

Nuno Diegues 3/17

slide-11
SLIDE 11

Problem at hands

But why are we aborting the transaction in the example?

B

w(z)

A

r(z)

X

Nuno Diegues 4/17

slide-12
SLIDE 12

Problem at hands

But why are we aborting the transaction in the example? Instead, we could do the following:

B

w(z)

A

r(z)

Serialization order: B, A

Nuno Diegues 4/17

slide-13
SLIDE 13

Problem at hands

Condition: Abort T if its reads are not up-to-date when it attempts to commit.

Nuno Diegues 5/17

slide-14
SLIDE 14

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

slide-15
SLIDE 15

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

slide-16
SLIDE 16

Permissiveness

Notion of avoiding unnecessary aborts

Nuno Diegues 6/17

slide-17
SLIDE 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

slide-18
SLIDE 18

Permissiveness

State of the art TMs far from being permissive.

Nuno Diegues 7/17

slide-19
SLIDE 19

Permissiveness

State of the art TMs far from being permissive. Cost is not negligible.

Nuno Diegues 7/17

slide-20
SLIDE 20

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

slide-21
SLIDE 21

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

slide-22
SLIDE 22

Goal

Enhance permissiveness without such costs

Nuno Diegues 8/17

slide-23
SLIDE 23

Goal

Enhance permissiveness without such costs: More restrictive abort condition Always read consistently Wait-free read-only transactions (mv-permissiveness)

Nuno Diegues 8/17

slide-24
SLIDE 24

Time-warping

Allow transactions to commit in the past

Nuno Diegues 9/17

slide-25
SLIDE 25

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

slide-26
SLIDE 26

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

slide-27
SLIDE 27

Time-warp

B

w(z)

A1

r(z) w(x)

Natural Commit: 1 Natural Commit: 2

Same history as before

Nuno Diegues 10/17

slide-28
SLIDE 28

Time-warp

B

w(z)

A1

Time-warp: 1

r(z) w(x)

Natural Commit: 1 Natural Commit: 2

Time-warp order

Nuno Diegues 10/17

slide-29
SLIDE 29

Time-warp

B

w(z)

A1

Time-warp: 1

r(z) w(x)

Natural Commit: 1 Natural Commit: 2 Time-warp: 1 - Ɛ

B time-warp commits

Nuno Diegues 10/17

slide-30
SLIDE 30

Time-warp

When can we not apply this idea?

Nuno Diegues 11/17

slide-31
SLIDE 31

Time-warp

When can we not apply this idea? Look out for a specific structure

Nuno Diegues 11/17

slide-32
SLIDE 32

Time-warp

When can we not apply this idea? Look out for a specific structure: Three transactions connected — a triad

Nuno Diegues 11/17

slide-33
SLIDE 33

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

slide-34
SLIDE 34

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

slide-35
SLIDE 35

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

slide-36
SLIDE 36

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

slide-37
SLIDE 37

Abort rule

B C

w(y) r(x) r(y) w(x)

A

C aborts here

Nuno Diegues 12/17

slide-38
SLIDE 38

Abort rule

B C

w(y) r(x) r(y) w(x)

A

r(y)

(rather strict) necessary condition for a cycle

Nuno Diegues 12/17

slide-39
SLIDE 39

Theoretical and Practical results

Serializability for committed transactions

Nuno Diegues 13/17

slide-40
SLIDE 40

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

slide-41
SLIDE 41

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

slide-42
SLIDE 42

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

slide-43
SLIDE 43

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

slide-44
SLIDE 44

SkipList and Vacation from STAMP

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

slide-45
SLIDE 45

SkipList and Vacation from STAMP

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

slide-46
SLIDE 46

Ongoing work 1/2

Nuno Diegues 15/17

slide-47
SLIDE 47

Ongoing work 1/2

Time-warp in a distributed transactional setting

Nuno Diegues 15/17

slide-48
SLIDE 48

Ongoing work 1/2

Time-warp in a distributed transactional setting: Generalizable to a variety of protocols

Nuno Diegues 15/17

slide-49
SLIDE 49

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

slide-50
SLIDE 50

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

slide-51
SLIDE 51

Ongoing work 2/2

Partially replicated large collections Scalable computations Transaction friendly despite structural conflicts

Nuno Diegues 16/17

slide-52
SLIDE 52

Thank you

Nuno Diegues 17/17