Disk Cache Memory Allocator with Multi-Size Free Lists
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data storage systems with disk caches face issues such as intensive lock contention, inefficient memory resource utilization due to uniform allocation across CPU cores with varying loads, and the need for complex defragmentation processes, which can lead to suboptimal performance and space waste.
Innovation Solution
The method involves maintaining free lists for distinct object sizes in pool memory, allowing for efficient allocation and deallocation of memory objects, reducing lock contention through partitioning and dynamic object size adaptation, and eliminating the need for separate defragmentation processes by merging pages at the zone object level.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Device complexity
If uniform memory allocation across CPU cores is used, then memory management is simplified, but lock contention increases and memory resource utilization becomes inefficient
Solution Approach 1:
The memory pool is divided into multiple partitions, with each partition further segmented into free lists of different object sizes. Each CPU core can access specific partitions, reducing lock contention while improving memory utilization. The segmentation allows parallel access without requiring a single global lock.
Solution Approach 2:
Different CPU cores are assigned different memory partitions based on their processing needs. Each core has localized access to specific memory regions, reducing the need for global locking and improving parallelism. This localizes memory management operations to specific cores and partitions.
2Quantity of substance
If separate defragmentation processes are implemented, then memory space can be reclaimed, but system complexity and processing overhead increase
Solution Approach 1:
When memory objects are freed, their pages are merged with adjacent free pages to form larger contiguous free blocks. This merging occurs automatically during the free operation, eliminating the need for separate defragmentation processes. The free lists are organized to facilitate efficient merging of adjacent free pages.
Solution Approach 2:
The memory allocation system performs its own defragmentation through the merging of free pages during deallocation operations. Instead of requiring external defragmentation processes, the system automatically consolidates free space, making it available for future allocations without additional overhead.
3Speed
If fixed-size memory objects are used, then allocation is simpler and faster, but memory space waste increases due to inability to adapt to varying request sizes
Solution Approach 1:
The system maintains multiple free lists with different object sizes (e.g., 4K, 8K, 16K pages) to dynamically adapt to varying allocation requests. When memory is allocated, the system selects the appropriate size from the free lists that matches the request, minimizing waste while maintaining fast allocation. The structure allows O(1) allocation by directly selecting from pre-organized size-based lists.
Data Source
AI summary
Managing pool memory in a data storage system includes maintaining free lists for corresponding object sizes. For a memory-consuming request (e.g., host write) an allocation operation is performed and the request data is stored. The allocation operation includes (1) selecting a memory object at least as large as the request size and removing all pages of the selected memory object from the corresponding free list, and (2) selecting pages of the selected memory object to store the request data and marking the selected pages as non-free, and leaving any leftover pages as free pages. For a memory-freeing request (e.g., destaging), a deallocation operation is performed that includes (1) marking the request pages free, and (2) based on neighboring pages being free, merging the request pages and neighboring pages into a corresponding memory object and adding the merged pages to the corresponding free list.


