AVIO class present
Upcoming SlideShare
Loading in...5
×
 

AVIO class present

on

  • 284 views

 

Statistics

Views

Total Views
284
Views on SlideShare
284
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

AVIO class present AVIO class present Presentation Transcript

  • AVIO: Detecting Atomicity Violations via Access Interleaving Invariants Dacong (Tony) Yan January 25, 2011
  • MotivationCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 2/21
  • MotivationCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 3/21
  • Agenda Motivation AVIO Idea AVIO Algorithms AVIO Implementations DiscussionCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 4/21
  • AVIO IdeaCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 5/21
  • AVIO Idea Idea: access interleaving invariants!CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 5/21
  • Eight Cases of Access InterleavingsCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 6/21
  • AVIO Idea Two PhasesCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 7/21
  • 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
  • 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
  • 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
  • AVIO Algorithms
  • Detection Algorithm What is an access inverleaving invariant?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 9/21
  • 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
  • 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
  • Extraction AlgorithmCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 10/21
  • 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
  • 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
  • AVIO Implementations
  • AVIO-H L1 cache line extensionCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 12/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
  • 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
  • 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
  • Discussion
  • Q1: How can we fix this bug?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 15/21
  • Solution: busy-waitingCSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 16/21
  • Q2: Will AVIO report this violation?CSE 788.07, Dacong (Tony) Yan AVIO: Detecting Atomicity Violations via Access Interleaving Invariants 17/21
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Thank you!