Skip to content

Commit e3211a5

Browse files
committed
Adds a simple note on the implementation of each allocator.
Signed-off-by: Nathan Ringo <me@remexre.com>
1 parent b3b9758 commit e3211a5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/kernel/mm/overview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ ukoOS has multiple strategies for memory management, that manage memory at diffe
55
- The kernel has a standard memory allocator, accessed with the functions `alloc` and `free`.
66
These functions act similarly to `malloc` and `free` in ordinary C.
77

8+
This is based on the design from [Mimalloc: Free List Sharding in Action](https://www.microsoft.com/en-us/research/wp-content/uploads/2019/06/mimalloc-tr-v1.pdf); read that if you want to understand the design.
9+
810
The allocator that handles these requests is called **the heap memory allocator**.
911

1012
- The kernel keeps track of all of RAM, and hands out pages to be mapped into userspace processes and to be used by the heap memory allocator.
1113

14+
This allocator is a simple free list.
15+
1216
This allocator is currently not capable of allocating more than a single contiguous page, but could be extended to support this in the future.
1317
This allocator is called **the physical memory allocator**.
1418

1519
- The kernel manages its own virtual memory, in the RAM region of the memory map.
1620

21+
This allocator is a pair of treaps, one for all VMAs sorted by address, and another for only free VMAs sorted by size.
22+
If you're not already familiar with treaps, there's a Julia Evans piece about them: [Data structure: the treap!](https://jvns.ca/blog/2017/09/09/data-structure--the-treap-/)
23+
1724
The allocator that handles these requests is called **the virtual memory allocator**.
1825

1926
Each hart has its own root page table, since it can be running a different userspace process.

0 commit comments

Comments
 (0)