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

skip to main content
research-article

Memory-Model-Aware Testing: A Unified Complexity Analysis

Published: 24 September 2015 Publication History

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

Cited By

View all
  • (2025)View-based axiomatic reasoning for the weak memory models PSO and SRAScience of Computer Programming10.1016/j.scico.2024.103225240(103225)Online publication date: Feb-2025
  • (2024)How Hard Is Weak-Memory Testing?Proceedings of the ACM on Programming Languages10.1145/36329088:POPL(1978-2009)Online publication date: 5-Jan-2024
  • (2023)Optimal Reads-From Consistency Checking for C11-Style Memory ModelsProceedings of the ACM on Programming Languages10.1145/35912517:PLDI(761-785)Online publication date: 6-Jun-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Embedded Computing Systems
ACM Transactions on Embedded Computing Systems  Volume 14, Issue 4
December 2015
604 pages
ISSN:1539-9087
EISSN:1558-3465
DOI:10.1145/2821757
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Journal Family

Publication History

Published: 24 September 2015
Accepted: 01 March 2015
Revised: 01 March 2015
Received: 01 October 2014
Published in TECS Volume 14, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. NP-completeness
  2. SAT
  3. Weak memory models
  4. complexity analysis
  5. testing

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

  • DFG project R2M2: Robustness against Relaxed Memory Models

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)16
  • Downloads (Last 6 weeks)3
Reflects downloads up to 29 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2025)View-based axiomatic reasoning for the weak memory models PSO and SRAScience of Computer Programming10.1016/j.scico.2024.103225240(103225)Online publication date: Feb-2025
  • (2024)How Hard Is Weak-Memory Testing?Proceedings of the ACM on Programming Languages10.1145/36329088:POPL(1978-2009)Online publication date: 5-Jan-2024
  • (2023)Optimal Reads-From Consistency Checking for C11-Style Memory ModelsProceedings of the ACM on Programming Languages10.1145/35912517:PLDI(761-785)Online publication date: 6-Jun-2023
  • (2023)View-Based Axiomatic Reasoning for PSOTheoretical Aspects of Software Engineering10.1007/978-3-031-35257-7_17(286-304)Online publication date: 4-Jul-2023
  • (2021)The reads-from equivalence for the TSO and PSO memory modelsProceedings of the ACM on Programming Languages10.1145/34855415:OOPSLA(1-30)Online publication date: 15-Oct-2021
  • (2020)Boosting Sequential Consistency Checking Using SaturationAutomated Technology for Verification and Analysis10.1007/978-3-030-59152-6_20(360-376)Online publication date: 19-Oct-2020
  • (2019)Gradual Consistency CheckingComputer Aided Verification10.1007/978-3-030-25543-5_16(267-285)Online publication date: 12-Jul-2019
  • (2018)Using temporal logics for specifying weak memory consistency modelsInternational Journal of Critical Computer-Based Systems10.5555/3302636.33026418:2(214-229)Online publication date: 1-Jan-2018
  • (2018)The Complexity of Weak ConsistencyFrontiers in Algorithmics10.1007/978-3-319-78455-7_17(224-237)Online publication date: 21-Mar-2018
  • (2017)Portability Analysis for Weak Memory Models porthos: One Tool for all ModelsStatic Analysis10.1007/978-3-319-66706-5_15(299-320)Online publication date: 19-Aug-2017

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media