time warp lightweight abort minimization in transactional
play

Time-Warp: Lightweight Abort Minimization in Transactional Memory - PowerPoint PPT Presentation

Time-Warp: Lightweight Abort Minimization in Transactional Memory Nuno Diegues and Paolo Romano ndiegues@gsd.inesc-id.pt Nuno Diegues 1/27 Transactional Memory Powerful abstraction for synchronization in shared memory Nuno Diegues 2/27


  1. Time-Warp: Lightweight Abort Minimization in Transactional Memory Nuno Diegues and Paolo Romano ndiegues@gsd.inesc-id.pt Nuno Diegues 1/27

  2. Transactional Memory Powerful abstraction for synchronization in shared memory Nuno Diegues 2/27

  3. Transactional Memory Powerful abstraction for synchronization in shared memory Executions equivalent to serial ones Nuno Diegues 2/27

  4. Transactional Memory Powerful abstraction for synchronization in shared memory Executions equivalent to serial ones Optimistic Nuno Diegues 2/27

  5. Transactional Memory Powerful abstraction for synchronization in shared memory Executions equivalent to serial ones Optimistic Transactions may abort to ensure correctness ◮ Typically, more aborts than needed Nuno Diegues 2/27

  6. Problem Linked ... head A D E List Nuno Diegues 3/27

  7. Problem B Linked ... head A D E List insert B T Nuno Diegues 3/27

  8. Problem B Linked ... head A D E List remove E U insert B T Nuno Diegues 3/27

  9. Problem B Linked ... head A D E List remove E U insert B T contains D? RO Nuno Diegues 3/27

  10. Problem B Linked ... head A D E List remove E U insert B T contains D? RO Nuno Diegues 4/27

  11. Problem B Linked ... head A D E List remove E U X insert B T contains D? RO Nuno Diegues 4/27

  12. Problem B Linked ... head A D E List remove E read-set: { head.next, A .next, D .next } U X write-set: { D .next } insert B read-set: { head.next, A .next } T write-set: { A .next } contains D? read-set: { head.next, A .next } RO Nuno Diegues 4/27

  13. Problem B Linked ... head A D E List remove E read-set: { head.next, A .next, D .next } U X write-set: { D .next } read write head.next: A B .next = D T read write A .next: D A .next = B contains D? read-set: { head.next, A .next } RO Nuno Diegues 4/27

  14. Problem B Linked ... head A D E List remove E read-set: { head.next, A .next, D .next } U X write-set: { D .next } read write head.next: A B .next = D T read write A .next: D A .next = B rw RO read read head.next: A A .next: D Nuno Diegues 4/27

  15. Problem B Linked ... head A D E List read read read write head.next: A A .next: D D .next = E D .next = E .next U X rw read write head.next: A B .next = D T read write A .next: D A .next = B rw RO read read head.next: A A .next: D Nuno Diegues 4/27

  16. Problem B Linked ... head A D E List read A .next: D U X rw T write A .next = B rw RO read A .next: D Nuno Diegues 4/27

  17. Problem To guarantee a given correctness level, a TM aborts transactions. Typical STMs use the following rule: Nuno Diegues 5/27

  18. Problem To guarantee a given correctness level, a TM aborts transactions. Typical STMs use the following rule: function commit ( Transaction tx ): for each ‹ datum , version › ∈ tx .readSet do if not latestVersion( datum , version ) then abort( tx ) Nuno Diegues 5/27

  19. Problem Condition: Abort T if its reads are not up-to-date when it attempts to commit. Nuno Diegues 6/27

  20. Problem Condition: Abort T if its reads are not up-to-date when it attempts to commit. Serializability: Necessary condition But not sufficient Nuno Diegues 6/27

  21. Problem 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 ◮ without being overly conservative (eg., precluding all concurrency) Nuno Diegues 6/27

  22. Objective B Linked ... head A D E List read A .next: D U X rw T write A .next = B rw RO read A .next: D Nuno Diegues 7/27

  23. Objective B Linked ... head A D E List read A .next: D U rw T write A .next = B rw RO read A .next: D Nuno Diegues 7/27

  24. Objective Lightweight minimization of spurious aborts: More restrictive abort condition Always read consistently Read-only transactions that never abort Nuno Diegues 7/27

  25. Outline Problem and Motivation Objective Existing Work Time-Warp Evaluation Nuno Diegues 8/27

  26. Existing Work Additional versions — fixed number in LSA [DISC06] MV-Permissiveness — as many as needed in JVSTM [PPoPP11] Permissiveness — AbortsAvoider [SPAA09] Interval-Based — AVSTM [DISC08] Nuno Diegues 9/27

  27. Existing Work Interval-Based : AVSTM [DISC08], TSTM [TPDS12], IR_VWC_P [ICA3PP11] Nuno Diegues 10/27

  28. Existing Work Interval-Based : AVSTM [DISC08], TSTM [TPDS12], IR_VWC_P [ICA3PP11] bounds for serialization order refined with transaction execution imposed by concurrent commits choose one value in the final interval Nuno Diegues 10/27

  29. Interval-based Approach Disadvantages: A read-only transaction may abort An update transaction may abort due to one miss Scalability issues on commit Nuno Diegues 11/27

  30. read x read y write y T 1 rw T 2 read x write x Nuno Diegues 12/27

  31. read x read y write y T 1 rw T 2 read x write x T 2 T 1 serialization time Nuno Diegues 12/27

  32. read x read y write y T 1 rw T 2 read x write x rw T 2 T 1 serialization time Decouple serialization order from commit order Nuno Diegues 12/27

  33. read x read y write y T 1 rw T 2 read x write x T 2 serialization Nuno Diegues 12/27

  34. read x read y write y T 1 rw T 2 read x write x rw T 1 T 2 serialization Nuno Diegues 12/27

  35. read x read y write y T 1 rw T 2 read x write x rw T 1 T 2 serialization Time-warp commit Nuno Diegues 12/27

  36. read x read y write y T 1 t=4 rw t=3 T 2 read x write x rw T 1 T 2 serialization Time-warp commit Nuno Diegues 12/27

  37. read x read y write y T 1 t=4 time-warp=2 rw t=3 T 2 read x write x rw T 1 T 2 serialization Time-warp commit — versions are produced with past version Nuno Diegues 12/27

  38. Abort Condition When can we not apply this idea? Nuno Diegues 13/27

  39. Abort Condition When can we not apply this idea? Look out for a specific structure Nuno Diegues 13/27

  40. Abort Condition When can we not apply this idea? Look out for a specific structure: write y read x Three transactions connected A B ◮ a triad rw rw T read y write x Nuno Diegues 13/27

  41. Abort Condition When can we not apply this idea? Look out for a specific structure: write y read x Three transactions connected A B ◮ a triad The link between all three rw rw ◮ the pivot Pivot T read y write x Nuno Diegues 13/27

  42. Abort Condition When can we not apply this idea? Look out for a specific structure: Three transactions connected write y read x A B ◮ a triad The link between all three rw rw ◮ the pivot Pivot T Abort if: read y write x ◮ Completes a triad ◮ Whose pivot time-warp commits Nuno Diegues 13/27

  43. Abort Condition wr write y write z read x read z A B Necessary condition (tighter) Still cheap enough to check rw rw Pivot T read y write x Nuno Diegues 13/27

  44. How to Validate Upon commit, transaction T performs: Nuno Diegues 14/27

  45. How to Validate Upon commit, transaction T performs: Validate each write k Nuno Diegues 14/27

  46. How to Validate Upon commit, transaction T performs: Validate each write k ◮ Detect if some concurrent T ′ read k ◮ If so, T ′ witnessed that T did not exist ◮ We forbid T from time-warping Nuno Diegues 14/27

  47. How to Validate Upon commit, transaction T performs: Validate each write k ◮ Detect if some concurrent T ′ read k ◮ If so, T ′ witnessed that T did not exist ◮ We forbid T from time-warping Validate each read k Nuno Diegues 14/27

  48. How to Validate Upon commit, transaction T performs: Validate each write k ◮ Detect if some concurrent T ′ read k ◮ If so, T ′ witnessed that T did not exist ◮ We forbid T from time-warping Validate each read k ◮ Detect if some concurrent T ′ committed a new version to k ◮ If so, T must time-warp Nuno Diegues 14/27

  49. How to Validate Upon commit, transaction T performs: Validate each write k ◮ Detect if some concurrent T ′ read k ◮ If so, T ′ witnessed that T did not exist ◮ We forbid T from time-warping Validate each read k ◮ Detect if some concurrent T ′ committed a new version to k ◮ If so, T must time-warp Abort T if it must time-warp, but cannot do so Nuno Diegues 14/27

  50. How to Validate Upon commit, transaction T performs: Validate each write k ◮ Detect if some concurrent T ′ read k ◮ If so, T ′ witnessed that T did not exist ◮ We forbid T from time-warping Validate each read k ◮ Detect if some concurrent T ′ committed a new version to k ◮ If so, T must time-warp Abort T if it must time-warp, but cannot do so Semi-visible readers scheme ◮ Know that some transaction read, not which ◮ Write transactions amortize the cost during read validation Nuno Diegues 14/27

  51. Evaluation Study Wide variety of benchmarks: Micro-benchmarks: skip-list Macro-benchmarks: STMBench7 and STAMP Nuno Diegues 15/27

  52. Evaluation Study Wide variety of benchmarks: Micro-benchmarks: skip-list Macro-benchmarks: STMBench7 and STAMP STMs spanning the design space: Nuno Diegues 15/27

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend