Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

Instrumentation bias for dynamic data race detection

Published: 12 October 2017 Publication History

Abstract

This paper presents Fast Instrumentation Bias (FIB), a sound and complete dynamic data race detection algorithm that improves performance by reducing or eliminating the costs of analysis atomicity. In addition to checking for errors in target programs, dynamic data race detectors must introduce synchronization to guard against metadata races that may corrupt analysis state and compromise soundness or completeness. Pessimistic analysis synchronization can account for nontrivial performance overhead in a data race detector.
The core contribution of FIB is a novel cooperative ownership-based synchronization protocol whose states and transitions are derived purely from preexisting analysis metadata and logic in a standard data race detection algorithm. By exploiting work already done by the analysis, FIB ensures atomicity of dynamic analysis actions with zero additional time or space cost in the common case. Analysis of temporally thread-local or read-shared accesses completes safely with no synchronization. Uncommon write-sharing transitions require synchronous cross-thread coordination to ensure common cases may proceed synchronization-free.
We implemented FIB in the Jikes RVM Java virtual machine. Experimental evaluation shows that FIB eliminates nearly all instrumentation atomicity costs on programs where data often experience windows of thread-local access. Adaptive extensions to the ownership policy effectively eliminate high coordination costs of the core ownership protocol on programs with high rates of serialized sharing. FIB outperforms a naive pessimistic synchronization scheme by 50% on average. Compared to a tuned optimistic metadata synchronization scheme based on conventional fine-grained atomic compare-and-swap operations, FIB is competitive overall, and up to 17% faster on some programs. Overall, FIB effectively exploits latent analysis and program invariants to bring strong integrity guarantees to an otherwise unsynchronized data race detection algorithm at minimal cost.

References

[1]
Sarita Adve. 2010. Data races are evil with no exceptions. Commun. ACM 53, 11 (Nov. 2010), 84.
[2]
Sarita V. Adve and Hans-Juergen Boehm. 2010. Memory Models: A Case for Rethinking Parallel Languages and Hardware. Commun. ACM 53 (Aug. 2010). Issue 8.
[3]
Sarita V. Adve and K. Gharachorloo. 1996. Shared Memory Consistency Models: A Tutorial. IEEE Computer 29, 12 (1996), 66–76.
[4]
Sarita V. Adve and Mark D. Hill. 1990. Weak Ordering—A New De�nition. In ACM/IEEE International Symposium on Computer Architecture.
[5]
Sarita V. Adve, Mark D. Hill, Barton P. Miller, and Robert H. B. Netzer. 1991. Detecting Data Races on Weak Memory Systems. In ACM/IEEE International Symposium on Computer Architecture.
[6]
Bowen Alpern, C. Richard Attanasio, John J. Barton, Anthony Cocchi, Susan Flynn Hummel, Derek Lieber, Ton Ngo, Mark F. Mergen, Janice C. Shepherd, and Stephen E. Smith. 1999. Implementing Jalapeño in Java. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. http://www.jikesrvm.org.
[7]
David F. Bacon, Ravi Konuru, Chet Murthy, and Mauricio Serrano. 1998. Thin Locks: Featherweight Synchronization for Java. In ACM Conference on Programming Language Design and Implementation.
[8]
Utpal Banerjee, Brian Bliss, Zhiqiang Ma, and Paul Petersen. 2006. A Theory of Data Race Detection. In Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging.
[9]
Tom Bergan, Owen Anderson, Joseph Devietti, Luis Ceze, and Dan Grossman. 2010. CoreDet: A Compiler and Runtime System for Deterministic Multithreaded Execution. In International Conference on Architectural Support for Programming Languages and Operating Systems.
[10]
Swarnendu Biswas, Minjia Zhang, Michael D. Bond, and Brandon Lucia. 2015. Valor: E�cient, Software-Only Region Con�ict Exceptions. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[11]
Stephen M. Blackburn, Robin Garner, Chris Ho�man, Asiad M. Khan, Kathryn S. McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z. Guyer, Martin Hirzel, Antony Hosking, Maria Jump, Han Lee, J. Eliot B. Moss, Aashish Phansalkar, Darko Stefanović, Thomas VanDrunen, Daniel von Dincklage, and Ben Wiedermann. 2006. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[12]
Hans-Juergen Boehm and Sarita V. Adve. 2008. Foundations of the C++ Concurrency Memory Model. In ACM Conference on Programming Language Design and Implementation.
[13]
Hans-Juergen Boehm and Sarita V. Adve. 2012. You Don’t Know Jack About Shared Variables or Memory Models. Commun. ACM 55, 2 (Feb. 2012), 48–54.
[14]
Michael D. Bond, Milind Kulkarni, Man Cao, Minjia Zhang, Meisam Fathi Salmi, Swarnendu Biswas, Aritra Sengupta, and Jipeng Huang. 2013. Octet: Capturing and Controlling Cross-Thread Dependences E�ciently. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[15]
Man Cao, Minjia Zhang, Aritra Sengupta, and Michael D. Bond. 2016. Drinking from Both Glasses: Combining Pessimistic and Optimistic Tracking of Cross-thread Dependences. In ACM Symposium on Principles and Practice of Parallel Programming.
[16]
Luis Ceze, Joseph Devietti, Brandon Lucia, and Shaz Qadeer. 2009. A Case for System Support for Concurrency Exceptions. In USENIX Workshop on Hot Topics in Parallelism �HotPar).
[17]
Jong-Deok Choi, Keunwoo Lee, Alexey Loginov, Robert O’Callahan, Vivek Sarkar, and Manu Sridharan. 2002. E�cient and Precise Datarace Detection for Multithreaded Object-Oriented Programs. In ACM Conference on Programming Language Design and Implementation.
[18]
Jong-Deok Choi and Sang Lyul Min. 1991. Race Frontier: Reproducing Data Races in Parallel-Program Debugging. In ACM Symposium on Principles and Practice of Parallel Programming.
[19]
Mark Christaens and Koen De Bosschere. 2001. A Topological Approach to On-the-�y Race Detection in Java Programs. In Symposium on Java Virtual Machine Research and Technology.
[20]
Joseph Devietti, Brandon Lucia, Luis Ceze, and Mark Oskin. 2009. DMP: Deterministic Shared Memory Multiprocessing. In International Conference on Architectural Support for Programming Languages and Operating Systems.
[21]
Joseph Devietti, Benjamin P. Wood, Karin Strauss, Luis Ceze, Dan Grossman, and Shaz Qadeer. 2012. RADISH: Always-On Sound and Complete Race Detection in Software and Hardware. In ACM/IEEE International Symposium on Computer Architecture.
[22]
Laura E�nger-Dean, Brandon Lucia, Luis Ceze, Dan Grossman, and Hans-Juergen Boehm. 2012. IFRit: Interference-free Regions for Dynamic Data-Race Detection. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[23]
Tayfun Elmas, Shaz Qadeer, and Serdar Tasiran. 2007. Goldilocks: A Race and Transaction-Aware Java Runtime. In ACM Conference on Programming Language Design and Implementation.
[24]
Colin Fidge. 1991. Logical Time in Distributed Computing Systems. IEEE Computer 24 (August 1991). Issue 8.
[25]
Stephen J. Fink and Feng Qian. 2003. Design, Implementation and Evaluation of Adaptive Recompilation with On-stack Replacement. In Proceedings of the IEEE/ACM International Symposium on Code Generation and Optimization.
[26]
Cormac Flanagan and Stephen N. Freund. 2000. Type-Based Race Detection for Java. In ACM Conference on Programming Language Design and Implementation.
[27]
Cormac Flanagan and Stephen N. Freund. 2009. FastTrack: E�cient and Precise Dynamic Race Detection. In ACM Conference on Programming Language Design and Implementation.
[28]
Cormac Flanagan and Stephen N. Freund. 2010. The RoadRunner Dynamic Analysis Framework for Concurrent Programs. In ACM SIGPLAN/SIGSOFT Workshop on Program Analysis for Software Tools and Engineering.
[29]
Cormac Flanagan and Stephen N. Freund. 2013. RedCard: Redundant Check Elimination For Dynamic Race Detectors. In European Conference on Object-Oriented Programming.
[30]
Cormac Flanagan and Stephen N. Freund. 2017. The FastTrack2 Race Detector. Technical Report CSTR201701. Williams College. Working draft – accessed 25 August 2017.
[31]
Cormac Flanagan, Stephen N. Freund, and Jaeheon Yi. 2008. Velodrome: A Sound And Complete Dynamic Atomicity Checker for Multithreaded Programs. In ACM Conference on Programming Language Design and Implementation.
[32]
K. Kawachiya, A. Koseki, and T. Onodera. 2002. Lock Reservation: Java Locks Can Mostly Do Without Atomic Operations. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[33]
Leslie Lamport. 1978. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM 21 (July 1978). Issue 7.
[34]
Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Comput. C-28, 9 (1979), 690–691.
[35]
Brandon Lucia, Luis Ceze, Karin Strauss, Shaz Qadeer, and Hans-Juergen Boehm. 2010. Con�ict Exceptions: Simplifying Concurrent Language Semantics with Precise Hardware Exceptions for Data-Races. In ACM/IEEE International Symposium on Computer Architecture.
[36]
Jeremy Manson, William Pugh, and Sarita V. Adve. 2005. The Java Memory Model. In ACM Symposium on Principles of Programming Languages.
[37]
Daniel Marino, Abhayendra Singh, Todd D. Millstein, Madanlal Musuvathi, and Satish Narayanasamy. 2010. DRFx: A Simple and E�cient Memory Model for Concurrent Programming Languages. In ACM Conference on Programming Language Design and Implementation.
[38]
Hassan Salehe Matar, Ismail Kuru, Serdar Tasiran, and Roman Dementiev. 2014. Accelerating Precise Race Detection Using Commercially-Available Hardware Transactional Memory Support. In Workshop on Determinism and Correctness in Parallel Programming.
[39]
Friedemann Mattern. 1989. Virtual Time and Global States of Distributed Systems. In International Workshop on Parallel and Distributed Algorithms. 215–226.
[40]
Sang L. Min and Jong-Deok Choi. 1991. An E�cient Cache-based Access Anomaly Detection Scheme. In International Conference on Architectural Support for Programming Languages and Operating Systems.
[41]
Abdullah Muzahid, Dario Suárez, Shanxiang Qi, and Josep Torrellas. 2009. SigRace: Signature-Based Data Race Detection. In ACM/IEEE International Symposium on Computer Architecture.
[42]
Mayur Naik, Alex Aiken, and John Whaley. 2006. E�ective Static Race Detection for Java. In ACM Conference on Programming Language Design and Implementation.
[43]
Takuya Nakaike and Maged M. Michael. 2010. Lock Elision for Read-Only Critical Sections in Java. In ACM Conference on Programming Language Design and Implementation.
[44]
Robert H. B. Netzer and Barton P. Miller. 1991. Improving the Accuracy of Data Race Detection. In ACM Symposium on Principles and Practice of Parallel Programming.
[45]
Robert H. B. Netzer and Barton P. Miller. 1992. What Are Race Conditions?: Some Issues and Formalizations. ACM Letters on Programming Languages and Systems 1, 1 (March 1992), 74âĂŞ88.
[46]
Marek Olszewski, Jason Ansel, and Saman Amarasinghe. 2009. Kendo: E�cient Deterministic Multithreading in Software. In International Conference on Architectural Support for Programming Languages and Operating Systems.
[47]
Mark S. Papamarcos and Janak H. Patel. 1984. A Low-Overhead Coherence Solution for Multiprocessors with Private Cache Memories. In ACM/IEEE International Symposium on Computer Architecture.
[48]
Yuanfeng Peng and Joseph Devietti. 2015. SlimFast: Reducing Metadata Redundancy in Sound & Complete Dynamic Data Race Detection. In PLDI Student Research Competition.
[49]
Yuanfeng Peng, Benjamin P. Wood, and Joseph Devietti. 2017. PARSNIP: Performant Architecture for Race Safety with No Impact on Precision. In ACM/IEEE International Symposium on Microarchitecture.
[50]
Filip Pizlo, Daniel Frampton, and Antony L. Hosking. 2011. Fine-grained Adaptive Biased Locking. In International Conference on Principles and Practice of Programming in Java.
[51]
Milos Prvulovic. 2006. CORD: Cost-e�ective (and nearly overhead-free) Order-Recording and Data race detection. In International Symposium on High-Performance Computer Architecture.
[52]
Milos Prvulovic and Josep Torrellas. 2003. ReEnact: Using Thread-Level Speculation Mechanisms to Debug Data Races in Multithreaded Codes. In ACM/IEEE International Symposium on Computer Architecture.
[53]
Ravi Rajwar and James R. Goodman. 2001. Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution. In ACM/IEEE International Symposium on Microarchitecture.
[54]
Dustin Rhodes, Cormac Flanagan, and Stephen N. Freund. 2017. BigFoot: Static Check Placement for Dynamic Race Detection. In ACM Conference on Programming Language Design and Implementation.
[55]
Ian Rogers and Balaji Iyengar. 2011. Reducing Biased Lock Revocation By Learning. In Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems.
[56]
K. Russell and D. Detlefs. 2006. Eliminating Synchronization-Related Atomic Operations with Biased Locking and Bulk Rebiasing. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[57]
Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, and Thomas Anderson. 1997. Eraser: A Dynamic Data Race Detector for Multithreaded Programs. ACM Transactions on Computer Systems 15, 4 (1997).
[58]
Konstantin Serebryany and Timur Iskhodzhanov. 2009. ThreadSanitizer: Data Race Detection in Practice. In Workshop on Binary Instrumentation and Applications.
[59]
Peter Sewell, Susmit Sarkar, Scott Owens, Francesco Zappa Nardelli, and Magnus O. Myreen. 2010. x86-TSO: A Rigorous and Usable Programmer’s Model for x86 Multiprocessors. Commun. ACM 53, 7 (July 2010), 89–97.
[60]
Tatiana Shpeisman, Vijay Menon, Ali-Reza Adl-Tabatabai, Steven Balensiefer, Dan Grossman, Richard L. Hudson, Katherine F. Moore, and Bratin Saha. 2007. Enforcing Isolation and Ordering in STM. In ACM Conference on Programming Language Design and Implementation.
[61]
Abhayendra Singh, Daniel Marino, Satish Narayanasamy, Todd D. Millstein, and Madanlal Musuvathi. 2011. E�cient Processor Support for DRFx, a Memory Model with Exceptions. In International Conference on Architectural Support for Programming Languages and Operating Systems.
[62]
Standard Performance Evaluation Corporation. 2005. SPECjbb2005. http://www.spec.org/jbb2005/ . (2005).
[63]
Nalini Vasudevan, Kedar S. Namjoshi, and Stephen A. Edwards. 2010. Simple and Fast Biased Locks. In International Conference on Parallel Architectures and Compilation Techniques.
[64]
Christoph von Praun and Thomas Gross. 2001. Object Race Detection. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[65]
James R. Wilcox, Parker Finch, Cormac Flanagan, and Stephen N. Freund. 2015. Array Shadow State Compression for Precise Dynamic Race Detection. In IEEE/ACM International Conference on Automated Software Engineering.
[66]
Benjamin P. Wood, Luis Ceze, and Dan Grossman. 2014. Low-Level Detection of Language-Level Data Races with LARD. In International Conference on Architectural Support for Programming Languages and Operating Systems.
[67]
Xi Yang, Stephen M. Blackburn, Daniel Frampton, Jennifer B. Sartor, and Kathryn S. McKinley. 2011. Why Nothing Matters: The Impact of Zeroing. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.
[68]
Yuan Yu, Tom Rodehe�er, and Wei Chen. 2005. RaceTrack: E�cient Detection of Data Race Conditions via Adaptive Tracking. In ACM Symposium on Operating Systems Principles.
[69]
P. Zhou, R. Teodorescu, and Y. Zhou. 2007. HARD: Hardware-Assisted Lockset-based Race Detection. In International Symposium on High-Performance Computer Architecture.

Cited By

View all
  • (2023)Inclusive Portraits: Race-Aware Human-in-the-Loop TechnologyProceedings of the 3rd ACM Conference on Equity and Access in Algorithms, Mechanisms, and Optimization10.1145/3617694.3623235(1-11)Online publication date: 30-Oct-2023
  • (2023)Dynamic Race Detection with O(1) SamplesProceedings of the ACM on Programming Languages10.1145/35712387:POPL(1308-1337)Online publication date: 11-Jan-2023
  • (2022)A tree clock data structure for causal orderings in concurrent executionsProceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3503222.3507734(710-725)Online publication date: 28-Feb-2022
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 1, Issue OOPSLA
October 2017
1786 pages
EISSN:2475-1421
DOI:10.1145/3152284
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 October 2017
Published in PACMPL Volume 1, Issue OOPSLA

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. cooperative synchronization
  2. data race detection
  3. dynamic analysis

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)60
  • Downloads (Last 6 weeks)7
Reflects downloads up to 02 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Inclusive Portraits: Race-Aware Human-in-the-Loop TechnologyProceedings of the 3rd ACM Conference on Equity and Access in Algorithms, Mechanisms, and Optimization10.1145/3617694.3623235(1-11)Online publication date: 30-Oct-2023
  • (2023)Dynamic Race Detection with O(1) SamplesProceedings of the ACM on Programming Languages10.1145/35712387:POPL(1308-1337)Online publication date: 11-Jan-2023
  • (2022)A tree clock data structure for causal orderings in concurrent executionsProceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3503222.3507734(710-725)Online publication date: 28-Feb-2022
  • (2020)BlockRaceProceedings of the IEEE/ACM 1st International Conference on Automation of Software Test10.1145/3387903.3389311(71-80)Online publication date: 7-Oct-2020
  • (2020)Atomicity Checking in Linear Time using Vector ClocksProceedings of the Twenty-Fifth International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3373376.3378475(183-199)Online publication date: 9-Mar-2020
  • (2019)Renaissance: benchmarking suite for parallel applications on the JVMProceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3314221.3314637(31-47)Online publication date: 8-Jun-2019

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media