skip to main content
research-article

Memory-Model-Aware Testing: A Unified Complexity Analysis

Published:24 September 2015Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. V. Adve and K. Gharachorloo. 1996. Shared memory consistency models: A tutorial. IEEE Computer 29, 12, 66--76. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Alglave. 2010. A Shared Memory Poetics. Ph.D. Dissertation. University Paris 7.Google ScholarGoogle Scholar
  5. J. Alglave. 2012. A formal hierarchy of weak memory models. Formal Methods in System Design 41, 2, 178--210. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Alglave. 2013. Weakness is a virtue. In Proceedings of the (EC)2 Workshop.Google ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle Scholar
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. B. Gibbons and E. Korach. 1997. Testing shared memories. SIAM Journal on Computing 26, 4, 1208--1244. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. R. Goodman. 1991. Cache Consistency and Sequential Consistency. Technical Report 1006. University of Wisconsin, Madison.Google ScholarGoogle Scholar
  26. 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 ScholarGoogle Scholar
  27. J. L. Hennessy and D. A. Patterson. 2003. Computer Architecture: A Quantitative Approach (3rd ed.). Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle Scholar
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Kuperstein, M. T. Vechev, and E. Yahav. 2011. Partial coherence abstractions for relaxed memory models. In PLDI. ACM, 187--198. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. L. Lamport. 1979. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Transactions on Computers 28, 9, 690--691. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle Scholar
  33. R. J. Lipton and J. S. Sandberg. 1988. PRAM: A Scalable Shared Memory. Technical Report CS-TR-180-88. Princeton University.Google ScholarGoogle Scholar
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  35. 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 ScholarGoogle Scholar
  36. D. Mosberger. 1993. Memory consistency models. ACM SIGOPS: Operating Systems Review 27, 1, 18--26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. R. C. Steinke and G. J. Nutt. 2004. A unified theory of shared memory consistency. Journal of the ACM 51, 5, 800--849. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. D. Weaver and T. Germond (Eds.). 1994. The SPARC Architecture Manual—Version 9. Prentice Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Memory-Model-Aware Testing: A Unified Complexity Analysis

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!