skip to main content
research-article

Verifying read-copy-update in a logic for weak memory

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

Read-Copy-Update (RCU) is a technique for letting multiple readers safely access a data structure while a writer concurrently modifies it. It is used heavily in the Linux kernel in situations where fast reads are important and writes are infrequent. Optimized implementations rely only on the weaker memory orderings provided by modern hardware, avoiding the need for expensive synchronization instructions (such as memory barriers) as much as possible. Using GPS, a recently developed program logic for the C/C++11 memory model, we verify an implementation of RCU for a singly-linked list assuming "release-acquire" semantics. Although release-acquire synchronization is stronger than what is required by real RCU implementations, it is nonetheless significantly weaker than the assumption of sequential consistency made in prior work on RCU verification. Ours is the first formal proof of correctness for an implementation of RCU under a weak memory model.

References

  1. Supplemental material for this paper available at the following URL: http://plv.mpi-sws.org/gps/rcu/.Google ScholarGoogle Scholar
  2. J. Alglave, D. Kroening, and M. Tautschnig. Partial orders for efficient bounded model checking of concurrent software. In CAV, 2013.Google ScholarGoogle Scholar
  3. M. Batty, S. Owens, S. Sarkar, P. Sewell, and T. Weber. Mathematizing C++ concurrency. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Bornat, C. Calcagno, P. O’Hearn, and M. Parkinson. Permission accounting in separation logic. In POPL, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Desnoyers, P. E. McKenney, A. S. Stern, M. R. Dagenais, and J. Walpole. User-level implementations of read-copy update. IEEE Trans. Parallel Distrib. Syst., 23(2):375–382, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. W. Dijkstra. EWD123: Cooperating Sequential Processes. Technical report, 1965. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Gotsman, N. Rinetzky, and H. Yang. Verifying concurrent memory reclamation algorithms with grace. In ESOP, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. ISO/IEC 9899:2011. Programming language C.Google ScholarGoogle Scholar
  9. R. Jung, D. Swasey, F. Sieczkowski, K. Svendsen, A. Turon, L. Birkedal, and D. Dreyer. Iris: Monoids and invariants as an orthogonal basis for concurrent reasoning. In POPL, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. on Computers, C-28(9): 690–691, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Mador-Haim, L. Maranget, S. Sarkar, K. Memarian, J. Alglave, S. Owens, R. Alur, M. Martin, P. Sewell, and D. Williams. An axiomatic memory model for POWER multiprocessors. In CAV. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. E. McKenney. Exploiting Deferred Destruction: An Analysis of Read-Copy-Update Techniques in Operating System Kernels. PhD thesis, OGI School of Science and Engineering at Oregon Health and Sciences University, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. P. E. McKenney and J. D. Slingwine. Read-copy update: Using execution history to solve concurrency problems. In PDCS, 1998.Google ScholarGoogle Scholar
  14. P. E. McKenney, T. Riegel, J. Preshing, H. Boehm, C. Nelson, and O. Giroux. N4215: Towards implementation and use of memory order consume, 2014. Available at http://www.open-std. org/jtc1/sc22/wg21/docs/papers/2014/n4215.pdf.Google ScholarGoogle Scholar
  15. J. C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. P. Sewell, S. Sarkar, S. Owens, F. Z. Nardelli, and M. O. Myreen. x86-TSO: A rigorous and usable programmer’s model for x86 multiprocessors. CACM, 53(7):89–97, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. Turon, V. Vafeiadis, and D. Dreyer. GPS: Navigating weak memory with ghosts, protocols, and separation. In OOPSLA, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. V. Vafeiadis. Concurrent separation logic and operational semantics. In MFPS, volume 276 of ENTCS, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. V. Vafeiadis and C. Narayan. Relaxed separation logic: A program logic for C11 concurrency. In OOPSLA, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. V. Vafeiadis, T. Balabonski, S. Chakraborty, R. Morisset, and F. Zappa Nardelli. Common compiler optimisations are invalid in the C11 memory model and what we can do about it. In POPL, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Verifying read-copy-update in a logic for weak memory

          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

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 50, Issue 6
            PLDI '15
            June 2015
            630 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/2813885
            • Editor:
            • Andy Gill
            Issue’s Table of Contents
            • cover image ACM Conferences
              PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation
              June 2015
              630 pages
              ISBN:9781450334686
              DOI:10.1145/2737924

            Copyright © 2015 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 3 June 2015

            Check for updates

            Qualifiers

            • research-article

          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!