skip to main content

Interval-based memory reclamation

Published:10 February 2018Publication History
Skip Abstract Section

Abstract

In this paper we present interval-based reclamation (IBR), a new approach to safe reclamation of disconnected memory blocks in nonblocking concurrent data structures. Safe reclamation is a difficult problem: a thread, before freeing a block, must ensure that no other threads are accessing that block; the required synchronization tends to be expensive. In contrast with epoch-based reclamation, in which threads reserve all blocks created after a certain time, or pointer-based reclamation (e.g., hazard pointers), in which threads reserve individual blocks, IBR allows a thread to reserve all blocks known to have existed in a bounded interval of time. By comparing a thread's reserved interval with the lifetime of a detached but not yet reclaimed block, the system can determine if the block is safe to free. Like hazard pointers, IBR avoids the possibility that a single stalled thread may reserve an unbounded number of blocks; unlike hazard pointers, it avoids a memory fence on most pointer-following operations. It also avoids the need to explicitly "unreserve" a no-longer-needed pointer.

We describe three specific IBR schemes (one with several variants) that trade off performance, applicability, and space requirements. IBR requires no special hardware or OS support. In experiments with data structure microbenchmarks, it also compares favorably (in both time and space) to other state-of-the-art approaches, making it an attractive alternative for libraries of concurrent data structures.

Skip Supplemental Material Section

Supplemental Material

References

  1. Dan Alistarh, Patrick Eugster, Maurice Herlihy, Alexander Matveev, and Nir Shavit. 2014. StackTrack: An Automated Transactional Approach to Concurrent Memory Reclamation. In Proc. of the 9th European Conf. on Computer Systems (EuroSys '14). Amsterdam, The Netherlands, 25:1--25:14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Dan Alistarh, William M. Leiserson, Alexander Matveev, and Nir Shavit. 2015. ThreadScan: Automatic and Scalable Memory Reclamation. In Proc. of the 27th ACM Symp. on Parallelism in Algorithms and Architectures (SPAA '15). Portland, OR, USA, 123--132. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Oana Balmau, Rachid Guerraoui, Maurice Herlihy, and Igor Zablotchi. 2016. Fast and Robust Memory Reclamation for Concurrent Data Structures. In Proc. of the 28th ACM Symp. on Parallelism in Algorithms and Architectures (SPAA '16). Pacific Grove, CA, USA, 349--359. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Anastasia Braginsky, Alex Kogan, and Erez Petrank. 2013. Drop the Anchor: Lightweight Memory Management for Non-blocking Data Structures. In Proc. of the 25th ACM Symp. on Parallelism in Algorithms and Architectures (SPAA '13). Montréal, Québec, Canada, 33--42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Trevor Brown. 2015. Reclaiming Memory for Lock-Free Data Structures: There Has to Be a Better Way. In Proc. of the 2015 ACM SIGACT-SIGOPS Symp. on Principles of Distributed Computing (PODC '15). Donostia-San Sebastián, Spain, 261--270. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Austin T. Clements, M. Frans Kaashoek, and Nickolai Zeldovich. 2012. Scalable Address Spaces Using RCU Balanced Trees. In Proc. of the 17th Intl. Conf. on Architectural Support for Programming Languages and Operating Systems (ASPLOS '12). London, England, UK, 199--210. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Nachshon Cohen and Erez Petrank. 2015. Efficient Memory Management for Lock-Free Data Structures with Optimistic Access. In Proc. of the 27th ACM Symp. on Parallelism in Algorithms and Architectures (SPAA '15). Portland, Oregon, USA, 254--263. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Dave Dice, Maurice Herlihy, and Alex Kogan. 2016. Fast Non-intrusive Memory Reclamation for Highly-concurrent Data Structures. In Proc. of the 2016 ACM SIGPLAN Intl. Symp. on Memory Management (ISMM '16). Santa Barbara, CA, USA, 36--45. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Aleksandar Dragojević, Maurice Herlihy, Yossi Lev, and Mark Moir. 2011. On the Power of Hardware Transactional Memory to Simplify Memory Management. In Proc. of the 2011 ACM SIGACT-SIGOPS Symp. on Principles of Distributed Computing (PODC '11). San Jose, CA, USA, 99--108. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. James R. Driscoll, Neil Sarnak, Daniel D. Sleator, and Robert E. Tarjan. 1986. Making Data Structures Persistent. In Proc. of the 18th Ann. ACM Symp. on Theory of Computing (STOC '86). Berkeley, CA, USA, 109--121. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Jason Evans. 2006. A scalable concurrent malloc (3) implementation for FreeBSD. In Proc. of the 2006 BSDCan Conf.Google ScholarGoogle Scholar
  12. Keir Fraser. 2004. Practical lock-freedom. Ph.D. Dissertation. Computer Laboratory, University of Cambridge. No. UCAM-CL-TR-579.Google ScholarGoogle Scholar
  13. Anders Gidenstam, Marina Papatriantafilou, Håkan Sundell, and Philippas Tsigas. 2009. Efficient and Reliable Lock-Free Memory Reclamation Based on Reference Counting. IEEE Trans. on Parallel and Distributed Systems 20, 8 (Aug 2009), 1173--1187. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Timothy L. Harris. 2001. A Pragmatic Implementation of Non-blocking Linked-Lists. In Proc. of the 15th Intl. Conf. on Distributed Computing (DISC '01). Springer-Verlag, Lisbon, Portugal, 300--314. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Thomas E. Hart, Paul E. McKenney, Angela Demke Brown, and Jonathan Walpole. 2007. Performance of Memory Reclamation for Lockless Synchronization. Journal of Parallel and Distributed Computing 67, 12 (Dec. 2007), 1270--1285. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Maurice Herlihy. 1993. A Methodology for Implementing Highly Concurrent Data Objects. ACM Trans. on Programming Languages and Systems 15, 5 (Nov. 1993), 745--770. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Maurice Herlihy, Victor Luchangco, Paul Martin, and Mark Moir. 2005. Nonblocking Memory Management Support for Dynamic-sized Data Structures. ACM Trans. on Computer Systems 23, 2 (May 2005), 146--196. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Håkan Sundell. 2005. Wait-Free Reference Counting and Memory Management. In 19th IEEE Intl. Parallel and Distributed Processing Symp. Denver, CO, USA, 24b--24b. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Paul E. McKenney, Dipankar Sarma, Andrea Arcangeli, Andi Kleen, Orran Krieger, and Rusty Russell. 2002. Read Copy Update. In 2002 Ottawa Linux Symp.Google ScholarGoogle Scholar
  20. Maged M. Michael. 2004. Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects. IEEE Trans. on Parallel and Distributed Systems 15, 8 (Aug. 2004), 491--504. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Maged M. Michael and Michael L. Scott. 1995. Correction of a Memory Management Method for Lock-Free Data Structures. Technical Report TR 599. Dept. of Computer Science, Univ. of Rochester. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Adam Morrison and Yehuda Afek. 2015. Temporally Bounding TSO for Fence-Free Asymmetric Synchronization. In Proc. of the 20th Intl. Conf. on Architectural Support for Programming Languages and Operating Systems (ASPLOS '15). Istanbul, Turkey, 45--58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Aravind Natarajan and Neeraj Mittal. 2014. Fast Concurrent Lock-free Binary Search Trees. In Proc. of the 19th ACM SIGPLAN Symp. on Principles and Practice of Parallel Programming (PPoPP '14). Orlando, FL, USA, 317--328. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Chris Okasaki. 1999. Purely functional data structures. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Pedro Ramalhete and Andreia Correia. 2017. Brief Announcement: Hazard Eras - Non-Blocking Memory Reclamation. In Proc. of the 29th ACM Symp. on Parallelism in Algorithms and Architectures (SPAA '17). Washington, DC, USA, 367--369. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. R. Kent Treiber. 1986. Systems Programming: Coping with Parallelism. Technical Report RJ 5118. IBM Almaden Research Center.Google ScholarGoogle Scholar
  27. John D. Valois. 1995. Lock-free Linked Lists Using Compare-and-swap. In Proc. of the 1995 ACM SIGACT-SIGOPS Symp. on Principles of Distributed Computing (PODC '95). Ottowa, Ontario, Canada, 214--222. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Interval-based memory reclamation

    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!