Disjoint-Access Parallelism: Impossibility, Possibility, and Cost - - PowerPoint PPT Presentation

disjoint access parallelism impossibility possibility and
SMART_READER_LITE
LIVE PREVIEW

Disjoint-Access Parallelism: Impossibility, Possibility, and Cost - - PowerPoint PPT Presentation

Disjoint-Access Parallelism: Impossibility, Possibility, and Cost of Transactional Memory Implementations Sebastiano Peluso 1 , Roberto Palmieri 1 , Paolo Romano 2 , Binoy Ravindran 1 and Francesco Quaglia 3 3 1 2


slide-1
SLIDE 1

Disjoint-­‐‒Access ¡Parallelism: ¡ Impossibility, ¡Possibility, ¡ and ¡Cost ¡of ¡Transactional ¡ Memory ¡Implementations

Sebastiano Peluso1, Roberto Palmieri1, Paolo Romano2, Binoy Ravindran1 and Francesco Quaglia3

1 2 3

ACM Symposium on Principles of Distributed Computing (PODC) 2015

slide-2
SLIDE 2

Degrees ¡of ¡Parallelism ¡

[SPAA08, ¡SPAA09]

  • Strict Disjoint-Access Parallelism (S-DAP): Two transactions do

not contend on a common base object if they do not access any common transactional object.

  • Weak Disjoint-Access Parallelism (W-DAP): Two transactions do

not concurrently contend on a common base object if there is no path between them in the conflict graph.

W(x) R(z) R(x) W(z) R(z) T3 T2 T1 S-­‐‒DAP: ¡T1 and ¡T3 cannot ¡contend on ¡a ¡ common ¡base ¡object. W-­‐‒DAP: ¡T1 and ¡T3 can ¡concurrently ¡ contend on ¡a ¡common ¡base ¡object.

ACM Symposium on Principles of Distributed Computing (PODC) 2015

x y z … versions locks clocks …

slide-3
SLIDE 3

Desirable ¡properties ¡in ¡TM

Disjoint-­‐‒Access ¡ parallelism ¡(DAP) Parallelism Wait-­‐‒free ¡and Invisible ¡(WFIRO) Read-­‐‒only ¡txs Obstruction-­‐‒free ¡(OFU) Update ¡txs

?

Isolation ¡Level Real-­‐‒time ¡Order ¡(RTO) Non-­‐‒concurrent ¡ txs

ACM Symposium on Principles of Distributed Computing (PODC) 2015

slide-4
SLIDE 4

Existing ¡Impossibility ¡Results

ACM Symposium on Principles of Distributed Computing (PODC) 2015

Impossibility ¡on ¡Wait-­‐‒free ¡Invisible ¡Read-­‐‒Only ¡(WFIRO)

[SPAA09, ¡TCS11] ¡

(Strict) Serializability Opacity Snapshot Isolation Lower Bound: Wait-free Read-only txs should write on at least t-1 base objects when t+1 processes execute. Impossibility ¡on ¡Obstruction-­‐‒free ¡ Updates ¡(OFU)

[SPAA08, ¡SPAA14] ¡

OFU + S-DAP + Serializability PCL Theorem: No TM can ensure S-DAP, Obstruction-freedom and Weak Adaptive Consistency (weaker than Snapshot Isolation and Processor Consistency). WFIRO + W-DAP +

slide-5
SLIDE 5

Roadmap ¡of ¡Results

  • Impossibility Results
  • Real-Time Order +
  • Wait-free Read-only Txs + WDAP +

1. Obstruction-free Update Txs 2. Invisible Read-only Txs + Weakly Progressive Update Txs

  • Possibility Result
  • Witnessable Real-Time Order +
  • Extended Update Serializability +
  • SDAP +
  • Wait-free Invisible Read-only Txs +
  • Strongly Progressive Update Transactions
  • … and corresponding costs
  • Space Complexity: Ω(min(No,Np)) per data-version
  • Time Complexity: Ω(k*No) per read operation

Np = ¡number ¡of ¡processes No = ¡number ¡of ¡objects k = ¡number ¡of ¡versions ¡per ¡object

slide-6
SLIDE 6
  • Real-time order (RTO) relation: T1 is ordered before T2 if the commit
  • f T1 precedes the begin of T2.
  • Transactions should appear as executed without violating the

Real-time order [PPoPP08].

What ¡about ¡Preserving ¡ Real-­‐‒Time ¡Order?

ACM Symposium on Principles of Distributed Computing (PODC) 2015

T2 T1

Executions

T1 T2

Possible ¡Serialization ¡Orders

T2 T1

T1 T2 T1 T2 T1 T2

slide-7
SLIDE 7

Impossibility ¡Results ¡on ¡ Real-­‐‒Time ¡Order

W-­‐‒DAP Wait-­‐‒free ¡Read-­‐‒only ¡ Txs Obstruction-­‐‒free ¡ Update ¡Txs Wait-­‐‒free ¡and ¡Invisible ¡ Read-­‐‒only ¡Txs Weakly ¡Progressive ¡ Update ¡Txs We ¡prove ¡that TM ¡cannot ¡preserve ¡Real-­‐‒time ¡ Order ¡(RTO)

ACM Symposium on Principles of Distributed Computing (PODC) 2015

Visible ¡Read-­‐‒only ¡Txs enable ¡S-­‐‒DAP ¡+ ¡ Opacity ¡[ICDCN11]

slide-8
SLIDE 8

Sketch ¡on ¡the ¡Impossibility: What ¡Should ¡a ¡Transaction ¡Read?

[Lemma 3 simplified] WDAP TM + WFRO + RTO Read the last committed value!

ACM Symposium on Principles of Distributed Computing (PODC) 2015

T1@pi α β R(x) ¡: ¡? δ γ W(x,1) ¡ T2@pj T*@pi α β R(x) ¡: ¡1 δ γ W(x,1) ¡

  • α, ¡β, ¡δ, ¡γ are ¡non-­‐‒conflicting ¡ intervals
  • T1 is ¡a ¡read-­‐‒only ¡transaction
  • T1 cannot ¡abort ¡because ¡of ¡WFRO

Indistinguishable ¡to ¡ process ¡pi because ¡of ¡ WDAP ¡(and ¡Lemmas ¡1, ¡2) T2@pj

Otherwise ¡RTO ¡is ¡not ¡preserved

R(x) ¡must ¡return ¡1!

slide-9
SLIDE 9

Sketch ¡on ¡the ¡Impossibility: Violating ¡the ¡Real-­‐‒Time ¡Order

ACM Symposium on Principles of Distributed Computing (PODC) 2015

T1@pi W(y,1) W(x,2) ¡ T2@pj R(y): ¡0 T3@pk R(x): ¡2 Obstruction-­‐‒free ¡Update ¡Txs

  • T1 commits ¡because ¡it ¡runs ¡solo ¡and ¡it ¡

cannot ¡wait ¡for ¡T3’s ¡outcome ¡ to ¡ commit

  • T2 commits ¡because ¡it ¡runs ¡solo

Weakly ¡Progressive ¡Update ¡Txs & ¡ Invisible ¡Read-­‐‒only ¡Txs

  • T1 commits ¡because ¡it ¡cannot ¡detect ¡the ¡

conflict ¡with ¡T3

  • T2 commits ¡because ¡it ¡does ¡not ¡

encounter ¡any ¡conflict

  • R(x) ¡must ¡return ¡2 ¡because ¡of ¡Lemma ¡3
  • Real-­‐‒Time ¡Order ¡violated: ¡T2 appears ¡as ¡executed ¡before ¡T1! ¡

By ¡contradiction ¡we ¡assume ¡that ¡WDAP ¡+ ¡WFRO ¡+ ¡RTO ¡is ¡possible, ¡then…

slide-10
SLIDE 10

Roadmap ¡of ¡Results

  • Impossibility Results
  • Real-Time Order +
  • Wait-free Read-only Txs + WDAP +

1. Obstruction-free Update Txs 2. Invisible Read-only Txs + Weakly Progressive Update Txs

  • Possibility Result
  • Witnessable Real-Time Order +
  • Extended Update Serializability +
  • SDAP +
  • Wait-free Invisible Read-only Txs +
  • Strongly Progressive Update Transactions
  • … and corresponding costs
  • Space Complexity: Ω(min(No,Np)) per data-version
  • Time Complexity: Ω(k*No) per read operation

Np = ¡number ¡of ¡processes No = ¡number ¡of ¡objects k = ¡number ¡of ¡versions ¡per ¡object

slide-11
SLIDE 11

A ¡Strictly ¡DAP ¡TM ¡Design

ACM Symposium on Principles of Distributed Computing (PODC) 2015

PARALLELISM S-DAP W-DAP NO DAP READ-ONLY UPDATES Wait-free Invisible Wait-free Visible and No Wait-free Strongly Progressive Obstruction- free Weakly Progressive ISOLATION Extended Update Serializability Opacity Serializability

  • Properties of Extended Update Serializability:
  • All transactions observe a serializable history (like Opacity!)
  • Committed Update Transactions are serializable (like Opacity!)
  • Two transactions T1, T2 can observe two non-compatible

serialization orders…

  • …but only if T1 and T2 will never commit any write operation

Witnessable Real-Time Order (WRTO) Real-Time Order preserved only among directly conflicting transactions, and transactions executed by the same process Consistent View

slide-12
SLIDE 12

Roadmap ¡of ¡Results

  • Impossibility Results
  • Real-Time Order +
  • Wait-free Read-only Txs + WDAP +

1. Obstruction-free Update Txs 2. Invisible Read-only Txs + Weakly Progressive Update Txs

  • Possibility Result
  • Witnessable Real-Time Order +
  • Extended Update Serializability +
  • SDAP +
  • Wait-free Invisible Read-only Txs +
  • Strongly Progressive Update Transactions
  • … and corresponding costs
  • Space Complexity: Ω(min(No,Np)) per data-version
  • Time Complexity: Ω(k*No) per read operation

Np = ¡number ¡of ¡processes No = ¡number ¡of ¡objects k = ¡number ¡of ¡versions ¡per ¡object

slide-13
SLIDE 13

Detected ¡Costs

  • The TM requires to store a vector clock of size Np per

data-version.

  • A read operation by a read-only T may validate T’s

read-set to check if it can return a data-version.

ACM Symposium on Principles of Distributed Computing (PODC) 2015

Space ¡Complexity

O(Np) integers ¡for ¡each ¡version ¡of ¡a ¡transactional ¡object

Time ¡Complexity

O(k*No) steps ¡to ¡execute ¡a ¡read ¡operation ¡of ¡a ¡read-­‐‒only ¡tx

Np = ¡number ¡of ¡processes No = ¡number ¡of ¡objects k = ¡number ¡of ¡versions ¡per ¡object

Are ¡these ¡costs ¡necessary?

slide-14
SLIDE 14

ACM Symposium on Principles of Distributed Computing (PODC) 2015

Consistent ¡View

  • Consistent View: all transactions read from a causally

consistent snapshot. It is weaker than EUS.

Opacity Strict Serializability Serializability Snapshot Isolation (Extended) Update Serializability Consistent View

[Adya99]

Forward Consistent View

[PPoPP08]

slide-15
SLIDE 15

Lower ¡Bound ¡on ¡the ¡ Space ¡Complexity ¡

  • Implementation of reads: return version V if V “does not

depend on” a version V* that overwrites the read-set.

T0@p0

Intuition ¡on ¡possible ¡S-­‐‒DAP ¡implementations

x 1 y 0 x 2 y 1 x 2 y 1 p0 1 p1 p2 p0 1 p1 p2 1 p0 1 p1 p2 1

  • verwrites

ACM Symposium on Principles of Distributed Computing (PODC) 2015

W(x, ¡A) R(x): ¡A R(y): ¡? W(x, ¡B) W(y, ¡C) T1@p1 T2@p2 T0@p0 W(x, ¡A) R(x): ¡A R(y): ¡? W(x, ¡B) W(y, ¡C) T1@p1 T2@p2

  • verwrites
  • Theorem. SDAP ¡TM ¡that ¡guarantees ¡WFIRO, ¡Consistent ¡ View, ¡WRTO ¡

and ¡either ¡obstruction-­‐‒free ¡ or ¡weakly ¡progressive ¡update ¡transactions The ¡space ¡complexity ¡for ¡each ¡version ¡of ¡a ¡transactional ¡object ¡is ¡ Ω(min(No,Np))

Status ¡of ¡the ¡memory ¡per ¡ data-­‐‒version Vector ¡clock ¡of ¡size ¡Np per ¡ data-­‐‒version

slide-16
SLIDE 16

Proving ¡the ¡Time ¡Complexity

ACM Symposium on Principles of Distributed Computing (PODC) 2015

R(x1): ¡0 T0@p0 R(xNo): ¡? R(xs): ¡0 T1@p1 W(xs): ¡1 W(xs+1): ¡1 W(xNo,1) R(x1): ¡0 T0@p0 R(xNo): ¡? R(xs): ¡0 T1@p1 W(xs+1): ¡1 W(xNo,1) W(xs-­‐‒1): ¡1

Read ¡s ¡objects Write ¡No-­‐‒ s ¡objects ¡ Write ¡No-­‐‒ s ¡objects ¡

R(x1): ¡0 T0@p0 R(xNo): ¡? R(xs): ¡0 T1@p1 W(xs+1): ¡1 W(xNo,1) W(xs-­‐‒2): ¡1

Write ¡No-­‐‒ s ¡objects ¡

R(x1): ¡0 T0@p0 R(xNo): ¡? R(xs): ¡0 T1@p1 W(xs+1): ¡1 W(xNo,1) W(x1): ¡1

Write ¡No-­‐‒ s ¡objects ¡ s histories Read ¡s ¡objects Read ¡s ¡objects Read ¡s ¡objects

slide-17
SLIDE 17

Lower ¡Bound ¡on ¡the ¡Time ¡ Complexity

  • In a WDAP TM with invisible read-only transactions

R(xNo) cannot distinguish the s histories unless it analyzes T0‘s read-set.

  • Consistent View + WRTO + WFIRO: T0 has to perform s

steps to check if R(xNo) can return 1.

  • s can be equal to No-1…and a read can check k

versions…

ACM Symposium on Principles of Distributed Computing (PODC) 2015

  • Theorem. WDAP ¡multi-­‐‒version ¡TM ¡that ¡guarantees ¡WFIRO, ¡

Consistent ¡View, ¡WRTO ¡and ¡either ¡obstruction-­‐‒free ¡ or ¡weakly ¡ progressive ¡update ¡transactions The ¡read-­‐‒only ¡time ¡complexity ¡is ¡Ω(k*No)

Read-­‐‒only ¡time ¡complexity: ¡the ¡maximum ¡number ¡of ¡steps ¡performed ¡by ¡any ¡ read ¡operation ¡of ¡any ¡read-­‐‒only ¡transaction

slide-18
SLIDE 18

Related ¡Results

Lower ¡Bound ¡on ¡the ¡Number ¡of ¡Visible ¡Reads [SPAA09, ¡TCS11] ¡

Hypothesis: WDAP TM + Strict Serializability + Minimal Progressive Update txs. Result: Wait-free Read-only txs should write on at least t-1 base objects when t+1 processes execute in a WDAP TM. Relation: The result is only a necessary condition in case Update txs are Obstruction-free since RTO cannot be preserved. The result is sufficient in case Update txs are Weakly Progressive [ICDCN11].

Impossibility ¡Result ¡in ¡Multi-­‐‒Version-­‐‒Permissive ¡ TM [PODC10] ¡

Hypothesis: WDAP TM + MV-Permissiveness Result: No Strict ¡Serializability. ¡ Relation: In a parasitic-free environment MV-­‐‒Permissiveness ¡could ¡provide ¡ Wait-­‐‒free ¡and ¡Invisible ¡Read-­‐‒only ¡txs and ¡Weakly ¡Progressive ¡Update ¡Txs. ¡In ¡that ¡ case ¡RTO ¡cannot ¡be ¡preserved.

Time ¡Complexity ¡in ¡Progressive ¡TM [PPoPP08] ¡

Hypothesis: Progressive single-version TM + Opacity Result: The maximum number of steps performed by any operation is Ω(Νο) Relation: Same cost to check if a version is observable in a multi-version WDAP TM with WRTO, wait-free and invisible read-only txs and Consistent View.

ACM Symposium on Principles of Distributed Computing (PODC) 2015

slide-19
SLIDE 19

Conclusions

  • Two impossibility results ruling DAP TM that

guarantees Real-Time Order and a set of desirable progress properties.

  • Possibility result: an SDAP TM that provides a strong

correctness property (i.e., EUS), Witnessable Real- Time Order, and the same set of progress properties as before.

  • Lower bounds on the space and time complexity of

such a DAP TM.

ACM Symposium on Principles of Distributed Computing (PODC) 2015

Our ¡Message

In a DAP TM lowering the consistency property is not

  • enough. Rather either invisible reads or wait-freedom

must be sacrificed!

slide-20
SLIDE 20

Thanks for the attention

peluso@vt.edu

ACM Symposium on Principles of Distributed Computing (PODC) 2015

slide-21
SLIDE 21

References

  • [Adya99] A. Adya. “Weak Consistency: A Generalized Theory and Optimistic

Implementations for Distributed Transactions”. PhD thesis, 1999. AAI0800775.

  • [ICDCN11] H. Attiya and E. Hillel. “Single version STMs can be multi-version

permissive”. In proc. of the 12th International Conference on Distributed Computing and Networking, ICDCN, 2011.

  • [PODC10]
  • [POPL09] R. Guerraoui and M. Kapalka. “The Semantics of Progress in Lock-based

Transactional Memory”. In proc. of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL), 2009.

  • [PPoPP08] R. Guerraoui and M. Kapalka. “On the Correctness of Transactional

Memory”. In proc. of the 13th ACM SIGPLAN Symposium on Principles and Practice

  • f Parallel Programming (PPoPP), 2008.
  • [SPAA08] R. Guerraoui and M. Kapalka. “On Obstruction-free Transactions.” In proc.
  • f the 20th annual Symposium on Parallelism in Algorithms and Architectures

(SPAA), 2008.

  • [SPAA09] Hagit Attiya, Eshcar Hillel, and Alessia Milani. “Inherent limitations on

disjoint-access parallel implementations of transactional memory.” In proc. of the 21st annual Symposium on Parallelism in Algorithms and Architectures (SPAA), 2009.

  • [SPAA14] Victor Bushkov, Dmytro Dziuma, Panagiota Fatourou, Rachid Guerraoui,

“The PCL Theorem. Transactions cannot be Parallel, Consistent and Live.”. In proc.

  • f the 26th annual Symposium on Parallelism in Algorithms and Architectures

(SPAA), 2014.

  • [TCS11] Hagit Attiya, Eshcar Hillel, and Alessia Milani. “Inherent limitations on disjoint-

access parallel implementations of transactional memory”. Theory Comput. Syst., 49(4):698–719, 2011.

ACM Symposium on Principles of Distributed Computing (PODC) 2015

slide-22
SLIDE 22

Backup slides

ACM Symposium on Principles of Distributed Computing (PODC) 2015

slide-23
SLIDE 23

ACM Symposium on Principles of Distributed Computing (PODC) 2015

Seeking ¡a ¡Sweet ¡Spot ¡in ¡ Disjoint-­‐‒Access ¡Parallel ¡TM

  • Objective: S-DAP + WFIRO

Isolation ¡Levels Progress ¡Guarantees ¡for ¡Update ¡Txs Obstruction-free Strongly progressive Weakly progressive Opacity Strict Serializability Serializability Snapshot Isolation (Extended) Update Serializability Consistent View

[Adya99] [POPL09]

Forward Consistent View

[PPoPP08]

slide-24
SLIDE 24

What ¡about ¡Preserving ¡ Real-­‐‒Time ¡Order?

  • Real-time order (RTO) relation: T1 is ordered before T2 if the commit
  • f T1 precedes the begin of T2.
  • Transactions should appear as executed without violating the

Real-time order [PPoPP08]. Real-time order violated if R(x) returned 1.

ACM Symposium on Principles of Distributed Computing (PODC) 2015

W(x,1) R(x) ¡: ¡? T3 T2 T1 W(x,2)

Examples

W(y,1) R(x) ¡: ¡? T3 T2 T1 W(x,1) R(y) ¡: ¡0

slide-25
SLIDE 25

Details ¡about ¡the ¡SDAP ¡TM

1

ACM Symposium on Principles of Distributed Computing (PODC) 2015

p0 A

1 1

p1 D

x

1

p0 B

1 1

p1 E

y

1

p0 C

1 1

p1 F

z T3@p3 R(x): ¡A T0@p0 W(y,G) T1@p1 W(y,E) T2@p2 W(z,F) R(y): ¡B W(x,D)

1 / / / / / / / / / / / /

R(x): ¡A

/ / / / 1 1 1 1

Abor t

Current ¡ Visible ¡ Snapshot Maximum ¡ Visible ¡ Snapshot Committed ¡ Snapshot Committed ¡ Snapshot Causally ¡dependent Causally ¡dependent Serializable updates: ¡locks ¡and ¡validation ¡ at ¡commit-­‐‒time Revalidate and ¡find ¡that:

  • ­‐‒ D ¡invalidates ¡the ¡read-­‐‒set
  • ­‐‒ D ¡and ¡E ¡are ¡dependent

R(z): ¡F

Revalidate and ¡find ¡that:

  • ­‐‒ D, ¡E ¡invalidate ¡the ¡read-­‐‒set
  • ­‐‒ D, ¡E ¡and ¡F ¡are ¡concurrent

/ / /

Np processes ¡= ¡Np elements ¡per ¡vector ¡ clock

slide-26
SLIDE 26

ACM Symposium on Principles of Distributed Computing (PODC) 2015

Consistent ¡View

  • Consistent View: all transactions read from a causally

consistent snapshot. It is weaker than EUS.

  • Forbidden Read: the read creates an oriented cycle

with exactly one write-after-read edge in the conflict graph [Adya99].

T2 T3 T1 WR WR

Example

R(x): ¡0 T1@p1 R(z): ¡4 T2@p2 W(y,3) W(x,2) T3@p3 W(z,4) R(y): ¡3