Abstract
Modern architectures rely on memory fences to prevent undesired weakenings of memory consistency. As the fences’ semantics may be subtle, the automation of their placement is highly desirable. But precise methods for restoring consistency do not scale to deployed systems’ code. We choose to trade some precision for genuine scalability: our technique is suitable for large code bases. We implement it in our new musketeer tool and report experiments on more than 700 executables from packages found in Debian GNU/Linux 7.1, including memcached with about 10,000 LoC.
- Parosh Aziz Abdulla, Mohamed Faouzi Atig, Yu-Fang Chen, Carl Leonardsson, and Ahmed Rezine. 2013. Memorax, A precise and sound tool for automatic fence insertion under TSO. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS’13) (LNCS). Springer, 530--536. Google Scholar
Digital Library
- Parosh Aziz Abdulla, Mohamed Faouzi Atig, Magnus Lang, and Tuan Phong Ngo. 2015. Precise and sound automatic fence insertion procedure under PSO. In International Conference on Networked Systems (NETYS’15).Google Scholar
Cross Ref
- Parosh Aziz Abdulla, Mohamed Faouzi Atig, and Tuan-Phong Ngo. 2015. The best of both worlds: Trading efficiency and optimality in fence insertion for TSO. In European Symposium on Programming on Programming (ESOP’15). Springer, 308--332. Google Scholar
Digital Library
- Sarita V. Adve and Kourosh Gharachorloo. 1995. Shared memory consistency models: A tutorial. IEEE Comput. 29, 12 (1995), 66--76. Google Scholar
Digital Library
- Jade Alglave, Daniel Kroening, John Lugton, Vincent Nimal, and Michael Tautschnig. 2011. Soundness of data flow analyses for weak memory models. In Programming Languages and Systems (APLAS’11) (LNCS), Vol. 7078. Springer, 272--288. Google Scholar
Digital Library
- Jade Alglave, Daniel Kroening, Vincent Nimal, and Michael Tautschnig. 2013. Software verification for weak memory via program transformation. In European Symposium on Programming (ESOP’13) (LNCS). Springer, 512--532. Google Scholar
Digital Library
- Jade Alglave and Luc Maranget. 2011. Stability in weak memory models. In Computer Aided Verification (CAV’11) (LNCS), Vol. 6806. Springer, 50--66. Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, S. Sarkar, and Peter Sewell. 2010. Fences in weak memory models. In Computer Aided Verification (CAV’10) (LNCS), Vol. 6174. Springer, 258--272. Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, and Michael Tautschnig. 2014. Herding cats: Modelling, simulation, testing, and data mining for weak memory. ACM Trans. Program. Lang. Syst. 36, 2, Article 7 (July 2014), 74 pages. Google Scholar
Digital Library
- John Bender, Mohsen Lesani, and Jens Palsberg. 2015. Declarative fence insertion. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’15). ACM, 367--385. Google Scholar
Digital Library
- Ahmed Bouajjani, Egor Derevenetc, and Roland Meyer. 2013. Checking and enforcing robustness against TSO. In European Symposium on Programming (ESOP’13) (LNCS), Vol. 7792. Springer, 533--553. Google Scholar
Digital Library
- Ahmed Bouajjani, R. Meyer, and E. Moehlmann. 2011. Deciding robustness against total store ordering. In Automata, Languages and Programming (ICALP’11) (LNCS), Vol. 6756. Springer, 428--440. Google Scholar
Digital Library
- C11. 2011. Information technology -- Programming languages -- C. In BS ISO/IEC 9899:2011.Google Scholar
- David Chase and Yossi Lev. 2005. Dynamic circular work-stealing deque. In Symposium on Parallelism in Algorithms and Architectures (SPAA’05). ACM, 21--28. Google Scholar
Digital Library
- David Detlefs, Christine H. Flood, Alex Garthwaite, Paul A. Martin, Nir Shavit, and Guy L. Steele Jr. 2000. Even better DCAS-based concurrent deques. In Distributed Computing (DISC’00) (LNCS), Vol. 1914. Springer, 59--73. Google Scholar
Digital Library
- David Dice. 2009. A race in LockSuport park() arising from weak memory models. Retrieved from https://blogs.oracle.com/dave/entry/a_race_in_locksupport_park.Google Scholar
- Edsger W. Dijkstra. 1965. Solution of a problem in concurrent programming control. Commun. ACM 8, 9 (1965), 569. Google Scholar
Digital Library
- Xing Fang, Jaejin Lee, and Samuel P. Midkiff. 2003. Automatic fence insertion for shared memory multiprocessing. In International Conference on Supercomputing (ICS’03). ACM, 285--294. Google Scholar
Digital Library
- Matteo Frigo, Charles E. Leiserson, and Keith H. Randall. 1998. The implementation of the Cilk-5 multithreaded language. In Programming Language Design and Implementation (PLDI’98). ACM, 212--223. Google Scholar
Digital Library
- Maurice Herlihy and Nir Shavit. 2008. The Art of Multiprocessor Programming. Morgan and Kaufmann, Burlington. Google Scholar
Digital Library
- IBM. 2009. Power ISA Version 2.06 Revision B.Google Scholar
- Saurabh Joshi and Daniel Kroening. 2015. Property-driven fence insertion using reorder bounded model checking. In International Symposium on Formal Methods (FM’15). Springer, 291--307.Google Scholar
Cross Ref
- Vineet Kahlon, Nishant Sinha, Erik Kruus, and Yun Zhang. 2009. Static data race detection for concurrent programs with asynchronous calls. In International Symposium on the Foundations of Software Engineering (FSE’09). ACM, 13--22. Google Scholar
Digital Library
- Arvind Krishnamurthy and Katherine A. Yelick. 1996. Analyses and optimizations for shared address space programs. J. Par. Dist. Comp. 38, 2 (1996), 130--144. Google Scholar
Digital Library
- Daniel Kroening and Michael Tautschnig. 2014. Automating software analysis at large scale. In Doctoral Workshop on Mathematical and Engineering Methods in Computer Science (MEMICS’14). Springer, 30--39.Google Scholar
Digital Library
- Michael Kuperstein, Martin T. Vechev, and Eran Yahav. 2010. Automatic inference of memory fences. In Formal Methods in Computer-Aided Design (FMCAD’10). IEEE, 111--119. Google Scholar
Digital Library
- Michael Kuperstein, Martin T. Vechev, and Eran Yahav. 2011. Partial-coherence abstractions for relaxed memory models. In Programming Language Design and Implementation (PLDI’11). 187--198. Google Scholar
Digital Library
- Leslie Lamport. 1979. How to make a correct multiprocess program execute correctly on a multiprocessor. IEEE Trans. Comput. 46, 7 (1979), 690--691. Google Scholar
Digital Library
- Leslie Lamport. 1987. A fast mutual exclusion algorithm. ACM Trans. Comput. Syst. 5, 1 (1987), 1--11. Google Scholar
Digital Library
- Jaejin Lee and David A. Padua. 2001. Hiding relaxed memory consistency with a compiler. IEEE Trans. Comput. 50 (2001), 824--833. Google Scholar
Digital Library
- Alexander Linden and Pierre Wolper. 2013. A verification-based approach to memory fence insertion in PSO memory systems. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS’13) (LNCS), Vol. 7795. Springer, 339--353. Google Scholar
Digital Library
- Feng Liu, Nayden Nedev, Nedyalko Prisadnikov, Martin T. Vechev, and Eran Yahav. 2012. Dynamic synthesis for relaxed memory models. In Programming Language Design and Implementation (PLDI’12). ACM, 429--440. Google Scholar
Digital Library
- Daniel Lustig, Caroline Trippel, Michael Pellauer, and Margaret Martonosi. 2015. ArMOR: Defending against memory consistency model mismatches in heterogeneous architectures. In International Symposium on Computer Architecture (ISCA’15). ACM, 388--400. Google Scholar
Digital Library
- Daniel Marino, Abhayendra Singh, Todd D. Millstein, Madanlal Musuvathi, and Satish Narayanasamy. 2011. A case for an SC-preserving compiler. In Programming Language Design and Implementation (PLDI’11). ACM, 199--210. Google Scholar
Digital Library
- Yuri Meshman, Andrei Dan, Martin Vechev, and Eran Yahav. 2014. Synthesis of memory fences via refinement propagation. In Static Analysis Symposium (SAS’14). Springer, 237--252.Google Scholar
Cross Ref
- Maged M. Michael and Michael L. Scott. 1996. Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In Symposium on Principles of Distributed Computing (PODC’96). ACM, 267--275. Google Scholar
Digital Library
- Maged M. Michael, Martin T. Vechev, and Vijay A. Saraswat. 2009. Idempotent work stealing. In Principles and Practice of Parallel Programming (PPOPP’09). ACM, 45--54. Google Scholar
Digital Library
- Vincent Nimal. 2015. Static Analyses over Weak Memory. Ph.D. Dissertation. University of Oxford.Google Scholar
- Brian Norris and Brian Demsky. 2013. CDSchecker: Checking concurrent data structures written with C/C++ atomics. In Object Oriented Programming Systems Languages & Applications (OOPSLA’13). 131--150. Google Scholar
Digital Library
- Scott Owens, Susmit Sarkar, and Peter Sewell. 2009. A better x86 memory model: x86-TSO. In Theorem Proving in Higher Order Logics (TPHOLs’09) (LNCS), Vol. 5674. Springer, 391--407. Google Scholar
Digital Library
- Gary L. Peterson. 1981. Myths about the mutual exclusion problem. Inf. Process. Lett. 12, 3 (1981), 115--116.Google Scholar
Cross Ref
- Dennis Shasha and Marc Snir. 1988. Efficient and correct execution of parallel programs that share memory. TOPLAS 10, 2 (1988), 282--312. Google Scholar
Digital Library
- SPARC. 1994. SPARC Architecture Manual Version 9. Google Scholar
Digital Library
- Michael F. Spear, Maged M. Michael, Michael L. Scott, and Peng Wu. 2009. Reducing memory ordering overheads in software transactional memory. In International Symposium on Code Generation and Optimization (CGO’09). IEEE, 13--24. Google Scholar
Digital Library
- Zehra Sura, Xing Fang, Chi-Leung Wong, Samuel P. Midkiff, Jaejin Lee, and David A. Padua. 2005. Compiler techniques for high performance sequentially consistent Java programs. In Symposium on Principles and Practice of Parallel Programming (PPOPP’05). ACM, 2--13. Google Scholar
Digital Library
- Boleslaw K. Szymanski. 1988. A simple solution to Lamport’s concurrent programming problem with linear wait. In International Conference on Supercomputing (ICS’88). 621--626. Google Scholar
Digital Library
- Robert Tarjan. 1973. Enumeration of the elementary circuits of a directed graph. SIAM J. Comput. 2, 3 (1973), 211--216.Google Scholar
Digital Library
- Viktor Vafeiadis and Francesco Zappa Nardelli. 2011. Verifying fence elimination optimisations. In Static Analysis (SAS’11) (LNCS), Vol. 6887. Springer, 146--162. Google Scholar
Digital Library
- Glynn Winskel. 1986. Event structures. In Petri Nets: Central Models and Their Properties, Advances in Petri Nets 1986, Part II, Proceedings of an Advanced Course. 325--392. Google Scholar
Digital Library
Index Terms
Don’t Sit on the Fence: A Static Analysis Approach to Automatic Fence Insertion
Recommendations
Declarative fence insertion
OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsPrevious work has shown how to insert fences that enforce sequential consistency. However, for many concurrent algorithms, sequential consistency is unnecessarily strong and can lead to high execution overhead. The reason is that, often, correctness ...
Don't Sit on the Fence
Proceedings of the 16th International Conference on Computer Aided Verification - Volume 8559Modern architectures rely on memory fences to prevent undesired weakenings of memory consistency. As the fences' semantics may be subtle, the automation of their placement is highly desirable. But precise methods for restoring consistency do not scale ...
Probabilistic Concurrency Testing for Weak Memory Programs
ASPLOS 2023: Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2The Probabilistic Concurrency Testing (PCT) algorithm that provides theoretical guarantees on the probability of detecting concurrency bugs does not apply to weak memory programs. The PCT algorithm builds on the interleaving semantics of sequential ...






Comments