You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Physical heap: switch from id heap to buddy memory allocator
This change introduces a new heap type that implements a buddy
memory allocator and is now used as physical memory heap; this
brings the following improvements:
- lower memory fragmentation: the buddy allocator keeps track of
free contiguous memory areas of each power-of-2 size, and when
allocating a requested size, uses a minimum-sized free area to
satisfy the request
- higher memory re-use (which maximizes TLB hit rate and minimizes
host memory usage): when there are multiple minimum-sized memory
areas available to satisfy an allocation request, the buddy
allocator selects the most recently used area
- higher scalability: the buddy allocator does not rely on linear
searches on a given memory range to select a free area; therefore,
the average CPU use to execute allocation requests does not
increase with the size of physical memory
The typical overhead of the buddy allocator is around 0.1%, i.e.
99.9% of the physical memory available for a VM can be used for
kernel and user program allocations.
The size of the bootstrap heap does no longer depend on the size
of physical memory, therefore calculation of the memory size is no
longer done when unneeded, and the bootstrap heap is set up in
common code instead of platform-specific code.
The PAGEHEAP_LOWMEM_PAGESIZE constant now sets the upper limit for
physical memory allocation requests on low-memory guests, and has
been changed to 1 MB to be able to allocate the async queue used by
the scheduler.
The `pages` kernel heap is now a simple wrapper (whose purpose is
to avoid complete exhaustion of physical memory) around the
page-backed heap, and is used by both the pagecache and the mmap
code.
0 commit comments