Rev 9 | Rev 15 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 9 | Rev 11 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | <?xml version="1.0" encoding="UTF-8"?> |
1 | <?xml version="1.0" encoding="UTF-8"?> |
| - | 2 | <chapter id="mm"> |
|
| - | 3 | <?dbhtml filename="mm.html"?> |
|
| 2 | 4 | ||
| - | 5 | <title>Memory management</title> |
|
| 3 | 6 | ||
| 4 | <chapter> |
7 | <section> |
| 5 | <title>Memory management</title> |
8 | <title>Virtual memory management</title> |
| 6 | 9 | ||
| 7 | <section> |
10 | <section> |
| 8 | <title>Virtual memory management</title> |
11 | <title>Address spaces</title> |
| 9 | 12 | ||
| 10 | <para></para> |
13 | <para></para> |
| 11 | </section> |
14 | </section> |
| 12 | 15 | ||
| 13 | <section> |
16 | <section> |
| 14 | <title>Physical memory management</title> |
17 | <title>Virtual address translation</title> |
| 15 | 18 | ||
| 16 | <para></para> |
19 | <para></para> |
| 17 | </section> |
20 | </section> |
| - | 21 | </section> |
|
| 18 | 22 | ||
| 19 | <section> |
23 | <section> |
| 20 | <title>Kernel allocators</title> |
24 | <title>Physical memory management</title> |
| 21 | - | ||
| 22 | 25 | ||
| - | 26 | <section id="zones_and_frames"> |
|
| - | 27 | <title>Zones and frames</title> |
|
| 23 | 28 | ||
| - | 29 | <para>Physical memory is divided into zones. Each zone represents |
|
| - | 30 | continuous area of physical memory frames. Allocation of frames is |
|
| - | 31 | handled by the <link linkend="buddy_allocator">buddy allocator</link> |
|
| - | 32 | associated with the zone. Zone also contains information about free and |
|
| - | 33 | occupied frames and its base addresss in the memory. Some of the |
|
| - | 34 | architectures (Mips, PPC) have only one zone, that covers whole physical |
|
| - | 35 | memory. Other architectures (IA32) have multiple zones.</para> |
|
| 24 | <section> |
36 | </section> |
| 25 | <title>Buddy allocator</title> |
- | |
| 26 | 37 | ||
| 27 | <para>Physical memory allocation is handled by buddy allocator.</para> |
38 | <section id="buddy_allocator"> |
| 28 | </section> |
39 | <title>Buddy allocator</title> |
| 29 | 40 | ||
| 30 | <section> |
41 | <para>Physical memory allocation inside one <link |
| - | 42 | linkend="zones_and_frames">memory zone</link> is being handled by buddy |
|
| - | 43 | allocation system. This approach greatly reduces possibility of memory |
|
| - | 44 | fragmentation and helps in allocating bigger continious blocks of |
|
| 31 | <title>Slab allocator</title> |
45 | physical memory aligned to their size.</para> |
| - | 46 | ||
| - | 47 | <graphic fileref="images/mm1.png" /> |
|
| - | 48 | ||
| - | 49 | <para>Frames are grouped into bigger blocks and blocks of the size i ^ 2 |
|
| - | 50 | are stored in the list indexed with <varname>i</varname> (so called |
|
| - | 51 | order index). If list contains 2 ajacent blocks (of a same size of |
|
| - | 52 | cause) they can be merged into the bigger one and moved into the list |
|
| - | 53 | with higher order index, thus making possible allocation of a bigger |
|
| 32 | </section> |
54 | block.</para> |
| 33 | </section> |
55 | </section> |
| 34 | 56 | ||
| 35 | - | ||
| 36 | <section> |
57 | <section> |
| 37 | <title>Memory sharing</title> |
58 | <title>Slab allocator</title> |
| 38 | 59 | ||
| 39 | <para></para> |
60 | <para>Kernel memory allocation is handled by slab.</para> |
| 40 | </section> |
61 | </section> |
| - | 62 | </section> |
|
| 41 | 63 | ||
| - | 64 | <section> |
|
| - | 65 | <title>Memory sharing</title> |
|
| 42 | 66 | ||
| 43 | - | ||
| - | 67 | <para>Not implemented yet(?)</para> |
|
| 44 | 68 | </section> |
|
| 45 | </chapter> |
69 | </chapter> |
| 46 | - | ||
| 47 | - | ||
| 48 | - | ||
| 49 | 70 | ||