-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate deterministic memory pool #94
Comments
0001-WIP-Integrate-deterministic-memory-pool.patch.gz implementation serves as proof of concept. |
Related: #105 |
HTFH-RT-Search-Cache is a real-time search cache build on top of a Hybrid TLSF Fixed Heap allocator with DLIRS mixed-strategy caching. See also: DLIRS: Improving Low Inter-Reference Recency Set Cache Replacement Policy with Dynamics
|
xvmalloc ever existed in Linux kernel. However, it was removed later. See also: War of allocators: TLSF in action |
Recent report on TLSF, xvMalloc, and zsmalloc. See linux2023-report. |
Fast Efficient Fixed-Size Memory Pool: No Loops and No Overhead
|
The TLSF memory allocation system consists of the following elements:
When a free slot is created or deleted in the memory pool, it is necessary to update the indexing data. Here is an example of how a slot size of 781 bytes is broken down according to the first (fl) and second level (sl) indexes:
The first-level indexing (fl) is done by classifying the size of the slot (minimum 4) by powers of 2 in 13 levels, from fl=3 to fl=15. The table below presents the slot sizes indexed by each first-level (fl) value. Second-level indexing (sl) is carried out by linearly classifying the size of the slot into 16 levels for each first level (fl). Example: For a level fl=5, all the values indexed by the second level range from 2^5 to 2^6-1, or 32 to 63. There are 16 possible levels for sl, so 32/16=2 values for each sl level. The values are thus:
The table below represents each possible fl/sl pair. For each pair, a start of a linked list is stored. This linked list only contains free slots whose minimum size is indicated in the table (the maximum size is not shown for clarity; it corresponds to the next cell's value minus 1). Reference: Arena Allocation |
RT-Mimalloc: A New Look at Dynamic Memory Allocation for Real-Time Systems
|
Related: #535 |
The main idea from the paper is that if we identify the slow path by checking the instructions executed per function during runtime, we can identify the slow paths. We can then try to modify the allocator in such a way that the longest observed allocation time (LOAT) is on par with TLSF. The proposed implementations leverage profile-driven initialization and make certain slow paths constant time. It's shown that modified mimalloc (called RT-mimalloc) can achieve a similar LOAT compared to TLSF and have a lower average allocation / de-allocation execution time, also able to support multi-threaded execution due to the lockless design, and have a lower fragmentation rate. However, RT-mimalloc exhibits higher peak memory usage compared to TLSF. |
TLSF (Two-Level Segregated Fit) dynamic memory allocation algorithm is guaranteed to complete allocation and deallocation operations in constant time, suitable for real-time applications.
Reference:
The text was updated successfully, but these errors were encountered: