Ping 时发布:并发数据结构内存回收中一种更好的保留信息发布方式
Publish on Ping: A Better Way to Publish Reservations in Memory Reclamation for Concurrent Data Structures
AI总结:
本文提出 publish-on-ping 内存回收方法,结合 POSIX 信号与延迟回收,让线程按需发布保留信息以替代风险指针,并构建 EpochPOP 变体,在多种数据结构和负载下实现 1.2-4 倍性能提升。
摘要:
利用每次读取保留信息的安全内存回收技术(例如风险指针)在遍历链式并发数据结构时通常会产生显著开销。这主要是因为在每次读取之前都需要声明保留信息,并通过内存屏障来强制实施适当的顺序。在读密集型工作负载中,这种开销会被放大,因为即使实际发生的内存回收相对较少,在遍历数据结构时仍然要承担保留记录的完整开销。本文提出了一种新颖的内存回收技术,该技术结合了 POSIX 信号和延迟回收,引入了一种“Ping 时发布”(publish-on-ping)方法。该方法消除了在使用前将保留信息全局可见的需求。相反,线程私下跟踪它们正在访问的记录,并在需要回收内存的线程请求时按需共享这些信息。该方法可以作为风险指针(hazard pointers)和风险纪元(hazard eras)的直接替代方案。此外,在数据结构操作遍历期间保留保留信息并按需发布的能力,有助于构建风险指针的一种变体(EpochPOP)。该变体使用纪元(epoch)方法,在线程不经常被延迟的常见情况下接近基于纪元的回收(epoch-based reclamation)的性能,同时保留风险指针的鲁棒性。我们基于风险指针(HP)和风险纪元的 publish-on-ping 实现,在应用于各种数据结构时表现出显著的性能提升。在各种工作负载和数据结构上的改进幅度为原始 HP 的 1.2 倍到 4 倍,与类似于 Folly 开源库中经过深度优化的 HP 实现相比最高提升 20%,并且比风险纪元快最多 3 倍。EpochPOP 提供了与基于纪元的回收相似的性能,同时提供更强的保证。
英文摘要:
Safe memory reclamation techniques that utilize per read reservations, such as hazard pointers, often cause significant overhead in traversals of linked concurrent data structures. This is primarily due to the need to announce a reservation, and fence to enforce appropriate ordering, before each read. In read-intensive workloads, this overhead is amplified because, even if relatively little memory reclamation actually occurs, the full overhead of reserving records is still incurred while traversing data structures. In this paper, we propose a novel memory reclamation technique by combining POSIX signals and delayed reclamation, introducing a publish-on-ping approach. This method eliminates the need to make reservations globally visible before use. Instead, threads privately track which records they are accessing, and share this information on demand with threads that intend to reclaim memory. The approach can serve as a drop-in replacement for hazard pointers and hazard eras. Furthermore, the capability to retain reservations during traversals in data structure operations and publish them on demand facilitates the construction of a variant of hazard pointers (EpochPOP). This variant uses epochs to approach the performance of epoch-based reclamation in the common case where threads are not frequently delayed (while retaining the robustness of hazard pointers). Our publish-on-ping implementations based on hazard pointers (HP) and hazard eras, when applied to various data structures, exhibit significant performance improvements. The improvements across various workloads and data structures range from 1.2X to 4X over the original HP, up to 20% compared to a heavily optimized HP implementation similar to the one in the Folly open-source library, and up to 3X faster than hazard eras. EpochPOP delivers performance similar to epoch-based reclamation while providing stronger guarantees.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。