skip to main content
10.1145/3437801.3441625acmconferencesArticle/Chapter ViewAbstractPublication PagesppoppConference Proceedingsconference-collections

NBR: neutralization based reclamation

Published:17 February 2021Publication History

ABSTRACT

Safe memory reclamation (SMR) algorithms suffer from a trade-off between bounding unreclaimed memory and the speed of reclamation. Hazard pointer (HP) based algorithms bound unreclaimed memory at all times, but tend to be slower than other approaches. Epoch based reclamation (EBR) algorithms are faster, but do not bound memory reclamation. Other algorithms follow hybrid approaches, requiring special compiler or hardware support, changes to record layouts, and/or extensive code changes. Not all SMR algorithms can be used to reclaim memory for all data structures.

We propose a new neutralization based reclamation (NBR) algorithm that is often faster than the best known EBR algorithms and achieves bounded unreclaimed memory. It is non-blocking when used with a non-blocking operating system (OS) kernel, and only requires atomic read, write and CAS. NBR is straightforward to use with many different data structures, and in most cases, requires similar reasoning and programmer effort to two-phased locking. NBR is implemented using OS signals and a lightweight handshaking mechanism between participating threads to determine when it is safe to reclaim a record. Experiments on a lock-based binary search tree and a lazy linked list show that NBR significantly outperforms many state of the art reclamation algorithms. In the tree, NBR is faster than next best algorithm, DEBRA, by up to 38% and HP by up to 17%. And, in the list, NBR is 15% and 243% faster than DEBRA and HP, respectively.

References

  1. Yehuda Afek, Haim Kaplan, Boris Korenfeld, Adam Morrison, and Robert E Tarjan. 2014. The CB tree: a practical concurrent self-adjusting search tree. Distributed computing 27, 6 (2014), 393--417.Google ScholarGoogle Scholar
  2. Dan Alistarh, Patrick Eugster, Maurice Herlihy, Alexander Matveev, and Nir Shavit. 2014. Stacktrack: An automated transactional approach to concurrent memory reclamation. In Proceedings of the Ninth European Conference on Computer Systems. 1--14.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Dan Alistarh, William Leiserson, Alexander Matveev, and Nir Shavit. 2017. Forkscan: Conservative memory reclamation for modern operating systems. In Proceedings of the Twelfth European Conference on Computer Systems. 483--498.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Dan Alistarh, William Leiserson, Alexander Matveev, and Nir Shavit. 2018. Threadscan: Automatic and scalable memory reclamation. ACM Transactions on Parallel Computing (TOPC) 4, 4 (2018), 1--18.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Oana Balmau, Rachid Guerraoui, Maurice Herlihy, and Igor Zablotchi. 2016. Fast and robust memory reclamation for concurrent data structures. In Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures. 349--359.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Guy E Blelloch and Yuanhao Wei. 2020. Concurrent Reference Counting and Resource Management in Wait-free Constant Time. arXiv preprint arXiv:2002.07053 (2020).Google ScholarGoogle Scholar
  7. Anastasia Braginsky, Alex Kogan, and Erez Petrank. 2013. Drop the anchor: lightweight memory management for non-blocking data structures. In Proceedings of the twenty-fifth annual ACM symposium on Parallelism in algorithms and architectures. 33--42.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Nathan G Bronson, Jared Casper, Hassan Chafi, and Kunle Olukotun. 2010. A practical concurrent binary search tree. ACM Sigplan Notices 45, 5 (2010), 257--268.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Trevor Brown. 2017. Techniques for Constructing Efficient Lock-free Data Structures. arXiv preprint arXiv:1712.05406 (2017).Google ScholarGoogle Scholar
  10. Trevor Brown, Faith Ellen, and Eric Ruppert. 2014. A General Technique for Non-blocking Trees. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '14). 329--342. Full version available from http://tbrown.pro.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Trevor Brown, Faith Ellen, and Eric Ruppert. 2014. A general technique for non-blocking trees. In Proceedings of the 19th ACM SIGPLAN symposium on Principles and practice of parallel programming. 329--342.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Trevor Brown, Aleksandar Prokopec, and Dan Alistarh. 2020. Non-blocking interpolation search trees with doubly-logarithmic running time. In Proceedings of the 25th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. 276--291.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Trevor Alexander Brown. 2015. Reclaiming memory for lock-free data structures: There has to be a better way. In Proceedings of the 2015 ACM Symposium on Principles of Distributed Computing. 261--270.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Nachshon Cohen. 2018. Every data structure deserves lock-free memory reclamation. Proceedings of the ACM on Programming Languages 2, OOPSLA (2018), 1--24.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Nachshon Cohen and Erez Petrank. 2015. Automatic memory reclamation for lock-free data structures. ACM SIGPLAN Notices 50, 10 (2015), 260--279.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Nachshon Cohen and Erez Petrank. 2015. Efficient memory management for lock-free data structures with optimistic access. In Proceedings of the 27th ACM symposium on Parallelism in Algorithms and Architectures. 254--263.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Tudor David, Rachid Guerraoui, and Vasileios Trigonakis. 2015. Asynchronized concurrency: The secret to scaling concurrent search data structures. ACM SIGARCH Computer Architecture News 43, 1 (2015), 631--644.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. David L Detlefs, Paul A Martin, Mark Moir, and Guy L Steele Jr. 2002. Lock-free reference counting. Distributed Computing 15, 4 (2002), 255--271.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Dave Dice, Maurice Herlihy, and Alex Kogan. 2016. Fast non-intrusive memory reclamation for highly-concurrent data structures. In Proceedings of the 2016 ACM SIGPLAN International Symposium on Memory Management. 36--45.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Dana Drachsler, Martin Vechev, and Eran Yahav. 2014. Practical concurrent binary search trees via logical ordering. In Proceedings of the 19th ACM SIGPLAN symposium on Principles and practice of parallel programming. 343--356.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Aleksandar Dragojević, Maurice Herlihy, Yossi Lev, and Mark Moir. 2011. On the power of hardware transactional memory to simplify memory management. In Proceedings of the 30th annual ACM SIGACT-SIGOPS symposium on Principles of distributed computing. 99--108.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Faith Ellen, Panagiota Fatourou, Joanna Helga, and Eric Ruppert. 2014. The amortized complexity of non-blocking binary search trees. In Proceedings of the 2014 ACM symposium on Principles of distributed computing. 332--340.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Faith Ellen, Panagiota Fatourou, Eric Ruppert, and Franck van Breugel. 2010. Non-blocking binary search trees. In Proceedings of the 29th ACM SIGACT-SIGOPS symposium on Principles of distributed computing. 131--140.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Jason Evans. 2006. A scalable concurrent malloc (3) implementation for FreeBSD. In Proc. of the bsdcan conference, ottawa, canada.Google ScholarGoogle Scholar
  25. Panagiota Fatourou, Elias Papavasileiou, and Eric Ruppert. 2019. Persistent non-blocking binary search trees supporting wait-free range queries. In The 31st ACM Symposium on Parallelism in Algorithms and Architectures. 275--286.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Keir Fraser. 2004. Practical lock-freedom. Technical Report. University of Cambridge, Computer Laboratory.Google ScholarGoogle Scholar
  27. Anders Gidenstam, Marina Papatriantafilou, Håkan Sundell, and Philippas Tsigas. 2008. Efficient and reliable lock-free memory reclamation based on reference counting. IEEE Transactions on Parallel and Distributed Systems 20, 8 (2008), 1173--1187.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Timothy L Harris. 2001. A pragmatic implementation of non-blocking linked-lists. In International Symposium on Distributed Computing. Springer, 300--314.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Thomas E Hart, Paul E McKenney, Angela Demke Brown, and Jonathan Walpole. 2007. Performance of memory reclamation for lockless synchronization. J. Parallel and Distrib. Comput. 67, 12 (2007), 1270--1285.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Meng He and Mengdu Li. 2017. Deletion without rebalancing in non-blocking binary search trees. In 20th International Conference on Principles of Distributed Systems (OPODIS 2016). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.Google ScholarGoogle Scholar
  31. Steve Heller, Maurice Herlihy, Victor Luchangco, Mark Moir, William N Scherer, and Nir Shavit. 2005. A lazy concurrent list-based set algorithm. In International Conference On Principles Of Distributed Systems. Springer, 3--16.Google ScholarGoogle Scholar
  32. Maurice Herlihy, Victor Luchangco, Paul Martin, and Mark Moir. 2005. Nonblocking memory management support for dynamic-sized data structures. ACM Transactions on Computer Systems (TOCS) 23, 2 (2005), 146--196.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Shane V Howley and Jeremy Jones. 2012. A non-blocking internal binary search tree. In Proceedings of the twenty-fourth annual ACM symposium on Parallelism in algorithms and architectures. 161--171.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Paul E McKenney and John D Slingwine. 1998. Read-copy update: Using execution history to solve concurrency problems. In Parallel and Distributed Computing and Systems, Vol. 509518.Google ScholarGoogle Scholar
  35. Maged M Michael. 2004. Hazard pointers: Safe memory reclamation for lock-free objects. IEEE Transactions on Parallel and Distributed Systems 15, 6 (2004), 491--504.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Aravind Natarajan and Neeraj Mittal. 2014. Fast concurrent lock-free binary search trees. In Proceedings of the 19th ACM SIGPLAN symposium on Principles and practice of parallel programming. 317--328.Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Ruslan Nikolaev and Binoy Ravindran. 2019. Hyaline: fast and transparent lock-free memory reclamation. In Proceedings of the 2019 ACM Symposium on Principles of Distributed Computing. 419--421.Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Ruslan Nikolaev and Binoy Ravindran. 2020. Universal wait-free memory reclamation. In Proceedings of the 25th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. 130--143.Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Aleksandar Prokopec, Nathan Grasso Bronson, Phil Bagwell, and Martin Odersky. 2012. Concurrent tries with efficient non-blocking snapshots. In Proceedings of the 17th ACM SIGPLAN symposium on Principles and Practice of Parallel Programming. 151--160.Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Arunmoezhi Ramachandran and Neeraj Mittal. 2015. CASTLE: fast concurrent internal binary search tree using edge-based locking. ACM SIGPLAN Notices 50, 8 (2015), 281--282.Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Arunmoezhi Ramachandran and Neeraj Mittal. 2015. A fast lock-free internal binary search tree. In Proceedings of the 2015 International Conference on Distributed Computing and Networking. 1--10.Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Pedro Ramalhete and Andreia Correia. 2017. Brief announcement: Hazard eras-non-blocking memory reclamation. In Proceedings of the 29th ACM Symposium on Parallelism in Algorithms and Architectures. 367--369.Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Niloufar Shafiei. 2013. Non-blocking Patricia tries with replace operations. In 2013 IEEE 33rd International Conference on Distributed Computing Systems. IEEE, 216--225.Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Ajay Singh, Trevor Brown, and Ali Mashtizadeh. 2020. NBR: Neutralization Based Reclamation. arXiv:2012.14542 [cs.DC]Google ScholarGoogle Scholar
  45. Shahar Timnat and Erez Petrank. 2014. A practical wait-free simulation for lock-free data structures. ACM SIGPLAN Notices 49, 8 (2014), 357--368.Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Haosen Wen, Joseph Izraelevitz, Wentao Cai, H Alan Beadle, and Michael L Scott. 2018. Interval-based memory reclamation. ACM SIGPLAN Notices 53, 1 (2018), 1--13.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. NBR: neutralization based 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

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader