Академический Документы
Профессиональный Документы
Культура Документы
Previous Work
Proposed Solution
Evaluation
Conclusions
December 4, 2014
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
1 Introduction
2 Previous Work
3 Proposed Solution
4 Evaluation
5 Conclusions
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Deadlocks
Parallel applications
- behaviour of concurrently running threads
- great number of bugs
Deadlocks
- synchronization mutex locks
- incorrect coordination in using locks
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Deadlocks
Deadlock immunity
- develop resistance against deadlocks
- automatically
- at runtime
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Language-level approaches
- new type systems: simplify
writing concurrent code
- + no runtime overhead
- - new languages/constructs
Transactional memory
- threads execute transactions
instead of synchronized blocks
- locking thread scheduling
- improve performance use
locks
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
System overview
RAG
- allocation graph
- built by Dimmunix based on
runtime events
Avoidance code
- intercept lock/unlock
- decide if GO/YIELD based on
cached RAG
- place events in queue for
Dimmunix
Monitor Thread
- build RAG
- update cached RAG for
Avoidance code
- cycle detection
- save deadlock/starvation
signatures
H. Jula, D. Tralamazza, C. Zamfir, G. Candea
Deadlock Immunity: Enabling Systems To Defend Against Deadlocks
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
RAG
Edges
- request - T wants to acquire L
(T L)
- allow - T waits for L (T L)
- hold - T acquired L (L T)
- yield - T cannot acquire L
because of T1(T T1)
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Detect Deadlocks/Starvation
Starvation cycles
- yield cycles
- T1 is reachable from T through yield
edges
- every T1 can reach T
Figure: Starvation cycles
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Deadlocks
- not part of Dimmunix
- program restart
- define recovery handlers, called after saving the signature
Starvation
- T - starved, holds most locks
- cancel yield for T
- go for the most recent requested lock
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Save signatures
- for detected deadlock/starvation cycles
- stack labels for all hold/yield edges
- general patterns - only call flow
Avoid Deadlocks
- request lock
-
- acquire lock
- allow edge hold edge
- acquired event to monitor
- release lock
- remove hold edge
- release event to monitor
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Avoid Deadlocks
- save a matching depth
- importance: miss deadlock/false positives
- fixed value/ heuristic
Avoid Starvation
- weak immunity
-
default
break starvation
ignore Dimmunix
miss some deadlocks
- strong immunity
- restart program
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Deadlock-free programs
- not affected by Dimmunix
- signatures saved on deadlock occurrences
Correct outputs
- alter thread scheduling
- non-real-time systems: the output does not depend on the scheduler
Lose functionality
- all execution paths are deadlocked
- user-disabled signatures
- automatically disable frequent patterns
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Implementations
- Java - byte code instrumentation
- POSIX threads: FreeBSD, LinuxNPTL - modified libraries
- no need to modify source code nor programming language
Experiments conditions
- real-systems integration: MySQL, Apache Active MQ, Java JDK
- strong immunity
- = 100 msec
Considered Topics
- Real deadlocks efficiency
- Performance Overhead
- False Positives
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Performance Overhead
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Performance Overhead
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
- Resource utilization
- 2-1024 threads, 8-32 locks, 64 signatures
- pthreads: 6-25 MB
- Java: 79-127 MB
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Further work
Communix
-
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions
Conclusions
Introduction
Previous Work
Proposed Solution
Evaluation
Conclusions