AVIO class present

351 views

Published on

Published in: Technology, Sports
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
351
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

AVIO class present

  1. 1. AVIO: Detecting Atomicity Violations via Access Interleaving Invariants Dacong (Tony) Yan January 25, 2011
  2. 2. MotivationCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 2/21
  3. 3. MotivationCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 3/21
  4. 4. Agenda Motivation AVIO Idea AVIO Algorithms AVIO Implementations DiscussionCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 4/21
  5. 5. AVIO IdeaCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 5/21
  6. 6. AVIO Idea Idea: access interleaving invariants!CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 5/21
  7. 7. Eight Cases of Access InterleavingsCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 6/21
  8. 8. AVIO Idea Two PhasesCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 7/21
  9. 9. AVIO Idea Two Phases Training: extracts access interleaving invariants from a large set of correct runs;CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 7/21
  10. 10. AVIO Idea Two Phases Training: extracts access interleaving invariants from a large set of correct runs; Detection: monitors the program execution, and checks whether the four buggy cases occur.CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 7/21
  11. 11. AVIO Idea Two Phases Training: extracts access interleaving invariants from a large set of correct runs; Detection: monitors the program execution, and checks whether the four buggy cases occur. Discussion Correctness: are correct runs indeed correct? Sufficiency: is the number of correct runs large enough?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 7/21
  12. 12. AVIO Algorithms
  13. 13. Detection Algorithm What is an access inverleaving invariant?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 9/21
  14. 14. Detection Algorithm What is an access inverleaving invariant? A pair of accesses (P-Instruction, I-Instruction).CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 9/21
  15. 15. Detection Algorithm What is an access inverleaving invariant? A pair of accesses (P-Instruction, I-Instruction). Detection procedure:CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 9/21
  16. 16. Extraction AlgorithmCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 10/21
  17. 17. Extraction Algorithm Idea: eliminate non-invariants from the whole set of pairs of accesses. 1. Suppose ai is an invariant: ai ∈ AISet; 2. If ai is violated in correct runs, remove ai from AISet.CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 10/21
  18. 18. Extraction Algorithm Idea: eliminate non-invariants from the whole set of pairs of accesses. 1. Suppose ai is an invariant: ai ∈ AISet; 2. If ai is violated in correct runs, remove ai from AISet. PseudocodeCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 10/21
  19. 19. AVIO Implementations
  20. 20. AVIO-H L1 cache line extensionCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 12/21
  21. 21. AVIO-H L1 cache line extension Hardware-based decision procedureCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 12/21
  22. 22. AVIO-S Two access tables Local access table: latest access information per thread Global access table: thread id of latest write among all threadsCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 13/21
  23. 23. AVIO-S Two access tables Local access table: latest access information per thread Global access table: thread id of latest write among all threads Detection at I-instruction P-instruction: extracts from local access table Remote access: extracts from global access tableCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 13/21
  24. 24. Discussion
  25. 25. Q1: How can we fix this bug?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 15/21
  26. 26. Solution: busy-waitingCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 16/21
  27. 27. Q2: Will AVIO report this violation?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 17/21
  28. 28. Q2: Will AVIO report this violation? Q2.1: Will < (shared == null)rd , (shared = newObj)wr > be included in AISet?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 17/21
  29. 29. Q2: Will AVIO report this violation? Q2.1: Will < (shared == null)rd , (shared = newObj)wr > be included in AISet? Yes!CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 17/21
  30. 30. Q2: Will AVIO report this violation? Q2.1: Will < (shared == null)rd , (shared = newObj)wr > be included in AISet? Yes! Q2.2: Will the buggy interleaving be detected?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 17/21
  31. 31. Q2: Will AVIO report this violation? Q2.1: Will < (shared == null)rd , (shared = newObj)wr > be included in AISet? Yes! Q2.2: Will the buggy interleaving be detected? Yes!CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 17/21
  32. 32. Q3: Why does AVIO-H have much lower overhead?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 18/21
  33. 33. Q3: Why does AVIO-H have much lower overhead? Answer: extra bits needed by the algorithm can be piggybacked in the cache coherence protocol, inducing very little extra cost.CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 18/21
  34. 34. Q4: Why does AVIO-H report more false positives?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 19/21
  35. 35. Q4: Why does AVIO-H report more false positives? Will an atomicity violation warning be raised by AVIO-H?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 20/21
  36. 36. Q4: Why does AVIO-H report more false positives? Will an atomicity violation warning be raised by AVIO-H? False sharingCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 20/21
  37. 37. Thank you!

×