1,48 → 1,69 |
<?xml version="1.0" encoding="UTF-8"?> |
<chapter id="mm"> |
<?dbhtml filename="mm.html"?> |
|
<title>Memory management</title> |
|
<chapter> |
<title>Memory management</title> |
<section> |
<title>Virtual memory management</title> |
|
<section> |
<title>Virtual memory management</title> |
<title>Address spaces</title> |
|
<para></para> |
</section> |
|
<section> |
<title>Physical memory management</title> |
<title>Virtual address translation</title> |
|
<para></para> |
</section> |
</section> |
|
<section> |
<title>Kernel allocators</title> |
<section> |
<title>Physical memory management</title> |
|
<section id="zones_and_frames"> |
<title>Zones and frames</title> |
|
<para>Physical memory is divided into zones. Each zone represents |
continuous area of physical memory frames. Allocation of frames is |
handled by the <link linkend="buddy_allocator">buddy allocator</link> |
associated with the zone. Zone also contains information about free and |
occupied frames and its base addresss in the memory. Some of the |
architectures (Mips, PPC) have only one zone, that covers whole physical |
memory. Other architectures (IA32) have multiple zones.</para> |
</section> |
|
<section> |
<title>Buddy allocator</title> |
<section id="buddy_allocator"> |
<title>Buddy allocator</title> |
|
<para>Physical memory allocation is handled by buddy allocator.</para> |
</section> |
<para>Physical memory allocation inside one <link |
linkend="zones_and_frames">memory zone</link> is being handled by buddy |
allocation system. This approach greatly reduces possibility of memory |
fragmentation and helps in allocating bigger continious blocks of |
physical memory aligned to their size.</para> |
|
<section> |
<title>Slab allocator</title> |
</section> |
<graphic fileref="images/mm1.png" /> |
|
<para>Frames are grouped into bigger blocks and blocks of the size i ^ 2 |
are stored in the list indexed with <varname>i</varname> (so called |
order index). If list contains 2 ajacent blocks (of a same size of |
cause) they can be merged into the bigger one and moved into the list |
with higher order index, thus making possible allocation of a bigger |
block.</para> |
</section> |
|
|
<section> |
<title>Memory sharing</title> |
<title>Slab allocator</title> |
|
<para></para> |
<para>Kernel memory allocation is handled by slab.</para> |
</section> |
</section> |
|
<section> |
<title>Memory sharing</title> |
|
|
|
</chapter> |
|
|
|
<para>Not implemented yet(?)</para> |
</section> |
</chapter> |