Ferad Zyulkyarov 1,2 , Tim Harris 3 , Osman S. Unsal 1 , Adrián Cristal 1 , Mateo Valero 1,2 1 BSC-Microsoft Research Centre 2 Universitat Politècnica de Catalunya 3 Microsoft Research Cambridge 15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming 09-14 January 2010 – Bangalore Debugging Programs that use Atomic Blocks and Transactional Memory
48
Embed
Debugging Programs that use Atomic Blocks and Transactional Memory
Debugging Programs that use Atomic Blocks and Transactional Memory. Ferad Zyulkyarov 1,2 , Tim Harris 3 , Osman S. Unsal 1 , Adrián Cristal 1 , Mateo Valero 1,2. 1 BSC-Microsoft Research Centre 2 Universitat Politècnica de Catalunya 3 Microsoft Research Cambridge. - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Ferad Zyulkyarov1,2, Tim Harris3, Osman S. Unsal1, Adrián Cristal1, Mateo Valero1,2
1BSC-Microsoft Research Centre2Universitat Politècnica de Catalunya
3Microsoft Research Cambridge
15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming09-14 January 2010 – Bangalore
Debugging Programs that use Atomic Blocks and Transactional Memory
2
Our Motivation
• It is difficult to debug transactional applications with existing debuggers
• Existing debuggers are not aware of atomic blocks and transactional memory– Lessons learnt from developing complex TM
applications such as Atomic Quake[1] and Quake TM [2].
[1] Zyulkyarov et al. “Atomic Quake: Using Transactional Memory in an Interactive Multiplayer Game Server“, PPoPP'09[2] Gajinov et al. “QuakeTM: Parallelizing a Complex Serial Application Using Transactional Memory “, ICS'09
Overview
• Debugging atomic blocks atomically• Examining the TM state• Managing the TM state at debug-time• Conflict point discovery• Design and implementation
3
Debugging at the Level of Atomic Blocks
• Debugger is extended with the semantics of atomic blocks– Atomicity – atomic blocks are treated as
single instruction– Isolation – the user does not observe
intermediate results of concurrently running transactions
• Hides the low level implementation details of atomic blocks (TM or lock inference)
4
Atomicity in Debugging• Step over atomic blocks as if single instruction.• Good for debugging sync errors at granularity of atomic
blocks vs. individual statements inside the atomic blocks.
User marks the startand the end of thetransactions
Data Race
25
Thread 1
atomic { local = counter; local++; counter = local;}
Thread 2
atomic { local = counter; local++;}counter = local;
StartDebugAtomicatomic { local = counter; local++;}counter = local;EndDebugAtomic
Split Atomic Block
• Useful to find unnecessarily large atomic blocks or searching for data races
26
atomic { s1;
s2;}
atomic { s1;<split> s2;}
atomic { s1;}
atomic { s2;}
• Debugging atomic blocks atomically• Examining the TM state• Managing the TM state at debug-time• Conflict point discovery• Design and implementation
27
Conflict Point Discovery
28
• TM applications have unanticipated overheads– Problem raised by Pankratius [talk at ICSE’09]
and Rossbach et al. [PPoPP’10]• Tells the users at which source lines how
many conflicts happen.– Useful to profile and optimize TM applications.
• More comprehensive than Reach Points Gajinov et al. [ICS’ 09]
Example OutputFile:Line #Conf. Method LineHashtable.cs:51 152 Add If (_container[hashCode]…
Hashtable.cs:48 62 Add uint hashCode = HashSdbm(…
Hashtable.cs:53 5 Add _container[hashCode] = n …
Hashtable.cs:83 5 Add while (entry != null) …
ArrayList.cs:79 3 Contains for (int i = 0; i < count; i++ )
ArrayList.cs:52 1 Add if (count == capacity – 1) …
29
Optimizing Genome
30
• Debugging atomic blocks atomically• Examining the TM state• Managing the TM state at debug-time• Conflict point discovery• Design and implementation
31
Design
32
Debugger Process
WinDbg
TmDbgExt
DbgEng
Target Process
Program
TmTargetDbg
StmLib
ShowRead set
Implements debugger commands
such as setting watchpoints, query
and modify the STM.
Wrapper around the STM to hide its implementation
details.
Function call on the target process.
Conclusion
• New principles and approaches for debugging TM applications– Debugging at the level of atomic blocks– Debugging at the level of transactions– Managing transactions at debug-time