Ralloc
Ralloc is a persistent-memory allocator that reconstructs allocation metadata by tracing reachable blocks after a crash.
Recovery: Reachability from persistent roots defines which blocks remain allocated. Application code must supply consistent persistent data and correct tracing; allocator recovery does not make arbitrary updates transactional. [2]
Progress: Lock freedom covers crash-free allocation and deallocation, not stop-the-world recovery. The paper discusses multi-process sharing but leaves its recovery coordination unimplemented. [2]
Tracing: Optional C++ filter functions enumerate pointers. Conservative scanning can retain non-pointer values that resemble references; filters depend on correct type descriptions. The pinned implementation does not support filters in pure C. [2] [3]
Pointers: The pinned pptr header encodes an offset from the pointer object's own address. Unchanged offsets survive remapping only when holder and target keep the same separation. Copy construction and assignment recompute it to preserve the target; copying the encoded integer alone changes the target when its storage address changes. [4]
Object copying: In the linked native example, a struct's default memberwise copy and move keep its pptr aimed at the source object's live member. Rebinding a copied graph requires application-specific knowledge of which targets should move. This is expected pointer-copy behavior, not an allocator defect. [1]
Persistence: atomic_pptr provides atomic load, store and compare-exchange on the offset, but these methods contain no write-back or persistence fence. Atomic access and durable completion are separate obligations. [4]
Example: The linked native header probe checks copy rebasing, equal-layout encoding transfer, null representation and failed compare-exchange. It does not run the allocator or test power loss. [5]
Relations
- related
- ABA problem, Self-relative pointer, Region ID in Value (RIV), Persistent memory, Durable linearizability, Crash consistency, NV-Heaps, Memory persistency
Limitations
- The recovery design excludes pointers into fields of an allocated block; successful member-pointer header tests do not validate recovery tracing. [2, 5]
- A filter that omits a live pointer can invalidate recovery's reachability assumptions. [2]
- The SHM_SIMULATING build option uses volatile /dev/shm storage, not power-loss-persistent memory. [3]
Citations
- Hesela. Native Ralloc struct-copy probe: memberwise copy, assignment, move and explicit rebinding.
- Cai et al. Understanding and Optimizing Persistent Memory Allocation. ISMM 2020, sections 2-5. DOI: 10.1145/3381898.3397212.
- Ralloc authors. README, pinned implementation 6b9d7a1: C filter restriction and simulation configuration.
- Ralloc authors. pptr.hpp, pinned implementation 6b9d7a1: offset conversion, copying and atomic operations.
- Hesela. Ralloc relative-pointer header probe: source, compiler checks and limitations.
Sources & caveats
- Full ISMM paper reviewed, including its assumptions, recovery discussion, proof and experimental setup. The six-author ISMM article is distinct from the five-author PPoPP brief announcement.
- Source checked at commit 6b9d7a1af75ba75232107bfaeb6a034799d5b182. The linked experiment executes unmodified MIT-licensed headers, not allocator recovery or a hardware benchmark.