Safe memory reclamation (SMR) algorithms are crucial for preventing use-after-free errors in optimistic data structures. SMR algorithms typically delay reclamation for safety and reclaim objects in batches for efficiency. It is difficult to strike a balance between performance and space efficiency. Small batch sizes and frequent reclamation attempts lead to high overhead, while freeing large batches can lead to long program interruptions and high memory footprints. An ideal SMR algorithm would forgo batching, and reclaim memory immediately, without suffering high reclamation overheads. To this end, we propose Conditional Access: a set of hardware instructions that offer immediate reclamation and low overhead in optimistic data structures. Conditional Access harnesses cache coherence to enable threads to efficiently detect potential use-after-free errors without explicit shared memory communication, and without introducing additional coherence traffic. We implement and evaluate Conditional Access in Graphite, a multicore simulator. Our experiments show that Conditional Access can rival the performance of highly optimized and carefully tuned SMR algorithms while simultaneously allowing immediate reclamation. This results in concurrent data structures with similar memory footprints to their sequential counterparts.
翻译:安全内存回收算法对于防止乐观数据结构中的无使用错误至关重要。 SMR算法通常会延迟安全回收,并批次回收物体以提高效率。很难在性能和空间效率之间取得平衡。小批量尺寸和频繁回收尝试会导致高管理费,而释放大批量可导致长时间程序中断和高记忆足迹。理想的SMR算法将放弃批量,并立即收回记忆,而不会遭受高回收管理费。为此,我们提议条件访问法:一套硬件指令,提供即时回收和降低乐观数据结构中的间接费用。 有条件访问法利用一致性使线条能够有效探测潜在的无使用错误,而没有明确的共享内存通信,并且不引入额外的一致性交通。我们实施并评价了在Fartite(多核模拟器)的有条件访问。我们的实验表明,有条件访问法可以与高度优化和仔细调整SMR算法的性能相匹配,同时允许立即回收。这导致同步的数据结构与相近的记忆足迹与其相近。</s>