an efficient software transactional memory using commit ... · few elements validation vs....

Post on 22-Sep-2020

3 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

An Efficient Software Transactional Memory Using Commit-Time Invalidation

CGO Justin E. Gottschlich, Manish Vachharajani,

and Jeremy G. Siek

University of Colorado-Boulder Gottschlich, Vachharajani, and Siek 1

• Problem o TM is not fast enough! (Cascaval et al., 2008)

• Reason oConflict Detection and Opacity

oMost TMs use Validation

• Our solution: o Full Invalidation

o InvalSTM

Gottschlich, Vachharajani, and Siek 2

Motivation

• Conflict Detection o Determine if transaction can commit

• (Papadimitrou, “Theory of Database Concurrency Control,” 1986)

• Opacity o Keep in-flight transactions consistent

• (Guerraoui & Kapalka, PPoPP’08)

Gottschlich, Vachharajani, and Siek 3

TM Performance Bottleneck

Conflict Detection

Gottschlich, Vachharajani, and Siek 4

Conflict: WT1 ∩ (WT2 ∪ RT2) ≠ Ø

• Validation (T2) oAnalyze the Past

• Version # is same

• Invalidation (T1) oAnalyze the Future

• T2.valid = false

Opacity

Gottschlich, Vachharajani, and Siek 5

• Validation oVersion # is same

• Invalidation oCheck valid != false

Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Validation Vs. Invalidation

6

# of in-flight transactions

ele

men

ts p

er tx

validation variable

validation

invalidation

Gottschlich, Vachharajani, and Siek

variable invalidation

Contending + Concurrent Workload

7

Commit to Executed Ratio: Commits / Executed Max = 1, Min = 0

Gottschlich, Vachharajani, and Siek Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

1-Writer, N-Reader

Side-By-Side Analysis

8

Commit / Executed: 1 / M Commit / Executed: (M-1) / M

Validation Invalidation

lim𝑀→∞

1

𝑀= 0 lim

𝑀→∞

(𝑀−1)

𝑀= 1

Gottschlich, Vachharajani, and Siek Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Algorithmic Growth

9

𝑗

𝑟𝑖

𝑗=1

𝑀

𝑖=1

Validation =

𝑟𝑖 + 𝑤𝑖 𝑠𝑟𝑗 𝑟𝑗 + 𝑠𝑤𝑗 𝑤𝑗

𝐹𝑖

𝑗=1

𝑀

𝑖=1

Invalidation =

𝑟𝑖 + (2𝑘𝑤 ∗ 𝐹𝑖)

𝑀

𝑖=1

Bloom Inval =

Gottschlich, Vachharajani, and Siek Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Efficient Read-Only Transactions

10

𝑗

𝑟𝑖

𝑗=1

𝑀

𝑖=1

Validation Read-Only =

𝑟𝑖

𝑀

𝑖=1

Invalidation Read-Only =

Gottschlich, Vachharajani, and Siek

𝑟𝑖 + 𝑤𝑖 𝑠𝑟𝑗 𝑟𝑗 + 𝑠𝑤𝑗 𝑤𝑗

𝐹𝑖

𝑗=1

𝑀

𝑖=1

Invalidation =

Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Validation + Memory

atomic { x = y / z; } Addressable memory

Cache line size

x

z

y

L1 Cache

N = Elements per tx O(N2) cache misses per tx

x

z

y

Gottschlich, Vachharajani, and Siek 11

Invalidation + Memory

atomic { x = y / z; } Addressable memory

Cache line size

x

z

y

L1 Cache

x z y

M = # of in-flight txes N = # of read elements O(N + M) cache miss per tx

x z y

? ? ?

Bloom Filter

? ? ?

Other Tx

Gottschlich, Vachharajani, and Siek 12 Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Linked List

Gottschlich, Vachharajani, and Siek 13 Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

1-Writer / N-Readers

Gottschlich, Vachharajani, and Siek 14 Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Hash Table

Gottschlich, Vachharajani, and Siek 15 Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Zoomed Hash Table

0

1000

2000

3000

64k 128k 256k

TL2

iFair

Gottschlich, Vachharajani, and Siek 16

validation

invalidation

inserts/lookups per thread

seco

nd

s

Few Txes Few Elements

Few Txes Many Elements

Many Txes Many Elements

Many Txes Few Elements

Conclusion • Invalidation (InvalSTM) can be efficient

• Next up o Proof of correctness for Full Invalidation

o InvalSTM + STAMP

• Special thanks to Spear and Herlihy Gottschlich, Vachharajani, and Siek 17

Few Txes Few Elements

Many Txes Many Elements

Many Txes Few Elements

# of in-flight transactions

ele

me

nts p

er tx

validation variable

validation

variable invalidation invalidation

Gottschlich, Vachharajani, and Siek 18

Questions?

Justin E. Gottschlich gottschl@colorado.edu

http://eces.colorado.edu/~gottschl/

top related