Abstract
To improve the performance of the memory system, multiprocessors implement weak memory consistency models. Weak memory models admit different views of the processes on their load and store instructions, thus allowing for computations that are not sequentially consistent. Program analyses have to take into account the memory model of the targeted hardware. This is challenging because numerous memory models have been developed, and every memory model requires its own analysis.
In this article, we study a prominent approach to program analysis: testing. The testing problem takes as input sequences of operations, one for each process in the concurrent program. The task is to check whether these sequences can be interleaved to an execution of the entire program that respects the constraints of a memory model under consideration. We determine the complexity of the testing problem for most of the known memory models. Moreover, we study the impact on the complexity of parameters, such as the number of concurrent processes, the length of their executions, and the number of shared variables.
What differentiates our contribution from related results is a uniform approach that avoids considering each memory model on its own. We build upon work of Steinke and Nutt. They showed that the existing memory models form a hierarchy where one model is called weaker than another one if it includes the latter’s behavior. Using the Steinke-Nutt hierarchy, we develop three general concepts that allow us to quickly determine the complexity of a testing problem. First, we generalize the technique of problem reductions from complexity theory. So-called range reductions propagate hardness results between memory models, and we apply them to establish NP lower bounds for the stronger memory models. Second, for the weaker models, we present polynomial-time testing algorithms that are inspired by determinization algorithms for automata. Finally, we describe a single SAT encoding of the testing problem that works for all memory models in the Steinke-Nutt hierarchy to prove their membership in NP. Our results are general enough to carry over to future weak memory models. Moreover, they show that SAT solvers are adequate tools for testing.
- P. A. Abdulla, M. F. Atig, Y. F. Chen, C. Leonardsson, and A. Rezine. 2012. Counter-example guided fence insertion under TSO. In Tools and Algorithms for the Construction and Analysis of Systems. Lecture Notes in Computer Science, Vol. 7214. Springer, 204--219. Google Scholar
Digital Library
- S. V. Adve and K. Gharachorloo. 1996. Shared memory consistency models: A tutorial. IEEE Computer 29, 12, 66--76. Google Scholar
Digital Library
- M. Ahamad, R. A. Bazzi, R. John, P. Kohli, and G. Neiger. 1993. The power of processor consistency. In Proceedings of the Symposium on Parallel Algorithms and Architectures (SPAA’93). ACM, New York, NY, 251--260. Google Scholar
Digital Library
- J. Alglave. 2010. A Shared Memory Poetics. Ph.D. Dissertation. University Paris 7.Google Scholar
- J. Alglave. 2012. A formal hierarchy of weak memory models. Formal Methods in System Design 41, 2, 178--210. Google Scholar
Digital Library
- J. Alglave. 2013. Weakness is a virtue. In Proceedings of the (EC)2 Workshop.Google Scholar
- J. Alglave, D. Kroening, V. Nimal, and D. Poetzl. 2014. Don’t sit on the fence—a static analysis approach to automatic fence insertion. In Computer Aided Verification. Lecture Notes in Computer Science, Vol. 8559. Springer, 208--524. Google Scholar
Digital Library
- J. Alglave, D. Kroening, and M. Tautschnig. 2013. Partial orders for efficient bounded model checking of concurrent software. In Computer Aided Verification. Lecture Notes in Computer Science, Vol. 8044. Springer, 141--157.Google Scholar
- J. Alglave and L. Maranget. 2011. Stability in weak memory models. In Computer Aided Verification. Lecture Notes in Computer Science, Vol. 6806. Springer, 50--66. Google Scholar
Digital Library
- M. F. Atig, A. Bouajjani, S. Burckhardt, and M. Musuvathi. 2010. On the verification problem for weak memory models. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, NY, 7--18. Google Scholar
Digital Library
- M. F. Atig, A. Bouajjani, S. Burckhardt, and M. Musuvathi. 2012. What’s decidable about weak memory models. In Programming Languages and Systems. Lecture Notes in Computer Science, Vol. 7211. Springer, 26--46. Google Scholar
Digital Library
- M. F. Atig, A. Bouajjani, and G. Parlato. 2011. Getting rid of store buffers in TSO analysis. In Computer Aided Verification. Lecture Notes in Computer Science, Vol. 6806. Springer, 99--115. Google Scholar
Digital Library
- A. Bouajjani, E. Derevenetc, and R. Meyer. 2013. Checking and enforcing robustness against TSO. In Programming Languages and Systems. Lecture Notes in Computer Science, Vol. 7792. Springer, 533--553. Google Scholar
Digital Library
- A. Bouajjani, R. Meyer, and E. Möhlmann. 2011. Deciding robustness against total store ordering. In Automata, Languages, and Programming. Lecture Notes in Computer Science, Vol. 6756. Springer, 428--440. Google Scholar
Digital Library
- S. Burckhardt and M. Musuvathi. 2008. Effective program verification for relaxed memory models. In Computer Aided Verification. Lecture Notes in Computer Science, Vol. 5123. Springer, 107--120. Google Scholar
Digital Library
- J. Burnim, K. Sen, and C. Stergiou. 2011. Sound and complete monitoring of sequential consistency for relaxed memory models. In Tools and Algorithms for the Construction and Analysis of Systems. Lecture Notes in Computer Science, Vol. 6605. Springer, 11--25. Google Scholar
Digital Library
- G. Calin, E. Derevenetc, R. Majumdar, and R. Meyer. 2013. A theory of partitioned global address spaces. In Proceedings of the IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science. 127--139.Google Scholar
- J. F. Cantin, M. H. Lipasti, and J. E. Smith. 2005. The complexity of verifying memory coherence and consistency. IEEE Transactions on Parallel and Distributed Systems 16, 7, 663--671. Google Scholar
Digital Library
- E. M. Clarke, O. Grumberg, S. Jha, Y. Lu, and H. Veith. 2000. Counterexample-guided abstraction refinement. In Computer Aided Verification. Lecture Notes in Computer Science, Vol. 1855. Springer, 154--160. Google Scholar
Digital Library
- E. Derevenetc and R. Meyer. 2014. Robustness against power is PSpace-complete. In Automata, Languages, and Programming. Lecture Notes in Computer Science, Vol. 8573. Springer, 158--170.Google Scholar
- J. Esparza and P. Ganty. 2011. Complexity of pattern based verification for multithreaded programs. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’11). ACM, New York, NY, 499--510. Google Scholar
Digital Library
- A. Farzan and P. Madhusudan. 2009. The complexity of predicting atomicity violations. In Tools and Algorithms for the Construction and Analysis of Systems. Lecture Notes in Computer Science, Vol. 5505. Springer, 155--169. Google Scholar
Digital Library
- F. Furbach, R. Meyer, K. Schneider, and M. Senftleben. 2014. Memory model-aware testing—a unified complexity analysis. In Proceedings of the 2014 14th International Conference on Application of Concurrency to System Design (ACSD’14). IEEE, Los Alamitos, CA, 92--101. Google Scholar
Digital Library
- P. B. Gibbons and E. Korach. 1997. Testing shared memories. SIAM Journal on Computing 26, 4, 1208--1244. Google Scholar
Digital Library
- J. R. Goodman. 1991. Cache Consistency and Sequential Consistency. Technical Report 1006. University of Wisconsin, Madison.Google Scholar
- A. Heddaya and H. Sinha. 1992. Coherence, Non-Coherence and Local Consistency in Distributed Shared Memory for Parallel Computing. Technical Report BU-CS-92-004. Boston University.Google Scholar
- J. L. Hennessy and D. A. Patterson. 2003. Computer Architecture: A Quantitative Approach (3rd ed.). Morgan Kaufmann. Google Scholar
Digital Library
- P. W. Hutto and M. Ahamad. 1990. Slow memory: Weakening consistency to enhance concurrency in distributed shared memories. In Proceedings of the 10th International Conference on Distributed Computing Systems. IEEE, Los Alamitos, CA, 302--309.Google Scholar
- D. Kozen. 1977. Lower bounds for natural proof systems. In Proceedings of the 18th Annual Symposium on Foundations of Computer Science (SFCS’77). IEEE, Los Alamitos, CA, 254--266. Google Scholar
Digital Library
- M. Kuperstein, M. T. Vechev, and E. Yahav. 2011. Partial coherence abstractions for relaxed memory models. In PLDI. ACM, 187--198. Google Scholar
Digital Library
- L. Lamport. 1979. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Transactions on Computers 28, 9, 690--691. Google Scholar
Digital Library
- R. Lawrence. 1998. A survey of cache coherence mechanisms in shared memory multiprocessors. In Proceedings of the International Conference on Advances in Computer Science and Electronics Engineering.Google Scholar
- R. J. Lipton and J. S. Sandberg. 1988. PRAM: A Scalable Shared Memory. Technical Report CS-TR-180-88. Princeton University.Google Scholar
- F. Liu, N. Nedev, N. Prisadnikov, M. T. Vechev, and E. Yahav. 2012. Dynamic synthesis for relaxed memory models. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, New York, NY, 429--440. Google Scholar
Digital Library
- P. Loewenstein, S. Chaudhry, R. Cypher, and C. Manovit. 2006. Multiprocessor memory model verification. In Proceedings of the Automated Formal Methods Workshop (AFM’06).Google Scholar
- D. Mosberger. 1993. Memory consistency models. ACM SIGOPS: Operating Systems Review 27, 1, 18--26. Google Scholar
Digital Library
- R. C. Steinke and G. J. Nutt. 2004. A unified theory of shared memory consistency. Journal of the ACM 51, 5, 800--849. Google Scholar
Digital Library
- D. Weaver and T. Germond (Eds.). 1994. The SPARC Architecture Manual—Version 9. Prentice Hall. Google Scholar
Digital Library
Index Terms
Memory-Model-Aware Testing: A Unified Complexity Analysis
Recommendations
Memory Model-Aware Testing - A Unified Complexity Analysis
ACSD '14: Proceedings of the 2014 14th International Conference on Application of Concurrency to System DesignTo improve performance, multiprocessor systems implement weak memory consistency models--and a number of models have been developed over the past years. Weak memory models, however, lead to unforeseen program behavior, and there is a current need for ...
Why is Combinational ATPG Efficiently Solvable for Practical VLSI Circuits?
Empirical observation shows that practically encountered instances of combinational ATPG are efficiently solvable. However, it has been known for more than two decades that ATPG is an NP-complete problem (Ibarra and Sahni, IEEE Transactions on Computers,...
Dynamic synthesis for relaxed memory models
PLDI '12Modern architectures implement relaxed memory models which may reorder memory operations or execute them non-atomically. Special instructions called memory fences are provided, allowing control of this behavior.
To implement a concurrent algorithm for a ...






Comments