Persistent Memory Pointer Swizzling via Slab Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In-memory applications using byte-addressable persistent memory face challenges with pointer invalidation due to virtual memory address randomization, requiring efficient swizzling techniques to maintain pointer validity during system restarts or crashes.
Innovation Solution
The approach involves pre-allocating slabs in the persistent heap for fixed-size object types, storing object type associations and pointer locations, and scanning these slabs during system recovery to update pointers, ensuring correct referencing without application-specific knowledge or significant storage overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If pointer swizzling is performed by scanning all objects in the persistent heap, then all pointers can be updated correctly, but the computational overhead during system recovery becomes very high
Solution Approach 1:
The persistent heap is divided into multiple slabs, where each slab is a contiguous memory segment configured to store instances of a specific object type. This segmentation allows the system to iterate through slabs in a structured manner and process only the relevant objects in each slab, rather than scanning the entire heap, thereby reducing computational overhead during pointer swizzling while maintaining complete pointer validity.
Solution Approach 2:
The system pre-stores associations between slabs and their respective object types, along with information indicating the locations of pointers in each object type. This preliminary organization of metadata enables the system to quickly identify and process only the objects that require pointer swizzling during recovery, avoiding unnecessary scanning of objects that do not contain pointers.
2Ease of operation
If the persistent heap is mapped to a fixed virtual address, then pointer swizzling is simplified, but security measures like address randomization cannot be implemented
Solution Approach 1:
The system dynamically adapts to different virtual address mappings by storing only the necessary pointer location information and slab-object type associations in the persistent heap. This dynamic approach allows the same persistent heap structure to work correctly regardless of whether the heap is mapped to a fixed address or randomly assigned addresses upon system restart, thus maintaining both ease of operation and security.
3Measurement precision
If application-specific knowledge is used to identify pointers for swizzling, then pointer identification becomes more accurate, but the system complexity increases
Solution Approach 1:
The slab-based approach with pre-stored associations between slabs and object types creates a universal mechanism that works for any object type without requiring application-specific knowledge. The system can identify and process pointers in any object type by iterating through slabs and using the stored metadata, thereby achieving accurate pointer identification while minimizing system complexity.
Data Source
AI summary
Techniques for efficiently swizzling pointers in persistent objects are provided. In one embodiment, a computer system can allocate slabs in a persistent heap, where the persistent heap resides on a byte-addressable persistent memory of the system, and where each slab is a continuous memory segment of the persistent heap that is configured to store instances of an object type used by an application. The system can further store associations between the slabs and their respective object types, and information indicating the locations of pointers in each object type. At the time of a system restart or crash recovery, the system can iterate through each slab and determine, based on the stored associations, the slab's object type. The system can then scan though the allocated objects in the slab and, if the system determines that the object includes any pointers based on the stored pointer location information, can swizzle each pointer.


