Brief Announcement Hyaline : Fast and Transparent Memory Reclamation Ruslan Nikolaev and Binoy Ravindran rnikola@vt.edu, binoy@vt.edu Systems Software Research Group Virginia Tech, USA
Memory Reclamation Problem ● Concurrent programming is hard – Non-blocking (lock-free) data structures require special treatment of deleted memory objects – Garbage collectors are often impractical in C/C++ ● Desirable properties for memory reclamation – Non-blocking : protecting non-blocking data structures – Robust : bound memory usage even when threads are stalled or preempted – Transparent : avoid implicit assumptions about threads; they can be created/deleted dynamically
Hyaline ● General idea – Distributed reference counting, triggered only when deleting objects – Maintains multiple global lists of deleted objects – Each list is used by a subset of threads Handle Handle Head [HRef, HPtr] ( Thread i ) ( Thread j ) New Head ... (1) 0 NRef NRef NRef ... (2) 0 ≤ 0 NRef NRef NRef + HRef ... (3) 0 NRef NRef NRef NRef
Comparison Scheme Performance Robust Transparent Extra API Memory complexity Reference Very Slow Yes Partially (swap) Double each Intrusive Counting pointer Hazard Pointers Slow Yes No (deletion) 1 word Hard Epoch Based Fast No No (deletion) 1 word Easy Reclamation Hazard Eras Fast Yes No (deletion) 3 words Hard Interval Based Fast Yes No (deletion) 3 words Medium Reclamation (2GEIBR) Hyaline Very Fast No Yes 3 words Easy Hyaline-1 Very Fast No Almost 3 words Easy Hyaline-S Fast Yes Yes 3 words Medium Hyaline-1S Fast Yes Almost 3 words Medium
Evaluation Xeon E7-8880 v3 2.30 GHz, 72 cores 125 0.25 Leak Memory Hyaline ● Hyaline−S IBR HP Leak Memory Hyaline ● Hyaline−S IBR > Epoch Hyaline−1 Hyaline−1S HE Epoch Hyaline−1 Hyaline−1S Throughput (M ops/sec) Throughput (M ops/sec) 100 ● 0.20 ● ● 75 0.15 ● ● 50 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Bonsai Tree 25 0.10 ● > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ● > > > > > 0 1 9 18 27 36 45 54 63 72 81 90 99 108 117 126 135 144 1 9 18 27 36 45 54 63 72 81 90 99 108 117 126 135 144 Threads Threads Retired Objects per Operation Epoch Hyaline ● Hyaline−S Retired Objects per Operation Epoch Hyaline ● Hyaline−S HE IBR Hyaline−1 Hyaline−1S IBR Hyaline−1 Hyaline−1S > HP 1500 ● 3000 ● ● Hash Map 1000 ● 2000 ● ● ● ● ● ● ● ● ● ● 500 ● 1000 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 > > > > > > > > > > > > > > > > > 0 1 9 18 27 36 45 54 63 72 81 90 99 108 117 126 135 144 1 9 18 27 36 45 54 63 72 81 90 99 108 117 126 135 144 Threads Threads
More details ● Code is open-source and available at: – https://github.com/rusnikola/lfsmr ● Full paper is available as an arXiv report: – https://arxiv.org/pdf/1905.07903.pdf Thank you!
Recommend
More recommend