进程管理和内存管理
linux内核源码进程管理和内存管理
我报一个班学习linux内核源码, 经过学习我将知识点整理到了这里: 整理知识点链接。
只能说我学到点表皮, 相信聚沙成塔。 如果你有兴趣学习,我可以为你推荐,老学员推荐新学员会有相应的折扣 加我QQ哈: 852897652.
我想快速的掌握linux内核,我将《Understanding the Linux Kernel》 这本书的图和表格整理在下面。
当然还有一本中文书籍 《Linux_内核情景分析》这两本书都是同事为我推荐的。
进程和内存
- 1.Introduction
- 2.Memory Address
- 3.Processes
- 5.Kernel Synchronization
- 6.Timing Measurements
- 7.Process Scheduling
- 8.Memory Management
- 9.Process Address Space
- 15.The Page Cache
- 17.Page Frame Reclaming
- 19.Process Communication
- 20.Program Execution
进程和内存详解
1. 1.Introduction
From the user’s point of view, files are organized in a treestructured namespace, as shown in Figure 1-1.
Figure 1-2 illustrates examples of transitions between User and Kernel Mode.
Figure 1-3 illustrates a few examples of noninterleaved and interleaved kernel control paths.
2. 2.Memory Address
Accesses to the GDT or LDT are necessary only when the contents of the segmentation registers change (see Figure 2-4).
Figure 2-5 shows in detail how a logical address is translated into a corresponding linear address.
The layout of the GDTs is shown schematically in Figure 2-6.
The Offset field determines the relative position within the page frame (see Figure 2-7).
Starting with the Pentium model, 80 × 86 microprocessors introduce extended paging, which allows page frames to be 4 MB instead of 4 KB in size (see Figure 2-8).
The corresponding entry must contain the physical address of the Page Table assigned to the process (see Figure 2-9).
As shown in Figure 2-10, the cache unit is inserted between the paging unit and the main memory.
As shown in Figure 2-11, each CPU has its own local hardware cache.
The four types of page tables illustrated in Figure 2-12 are called:
• Page Global Directory
• Page Upper Directory
• Page Middle Directory
• Page Table
. Figure 2-12 does not show the bit numbers, because the size of each part depends on the computer architecture.
Figure 2-13 shows how the first 3 MB of RAM are filled by Linux.
The provisional Page Tables are stored starting from pg0, right after the end of the kernel’s uninitialized data segments (symbol _end in Figure 2-13).
Figure 2-3 illustrates the format of a Segment Descriptor; the meaning of the various fields is explained in Table 2-1.
Table 2-3 shows the values of the Segment Descriptor fields for these four crucial segments.
Table 2-4 summarizes the main characteristics of the hardware paging systems used by some 64-bit platforms supported by Linux.
- This change has been made to fully support the linear address bit splitting used by the x86_64 platform (see Table 2-4).
- Finally, for 64-bit architectures three or four levels of paging are used depending on the linear address bit splitting performed by the hardware (see Table 2-4).
Now, let’s discuss the macros listed in Table 2-7 that combine a page address and a group of protection flags into a page table entry or perform the reverse operation of extracting the page address from a page table entry.
Later, the kernel executes the machine_specific_memory_setup() function, which builds the physical addresses map (see Table 2-9 for an example).
A typical configuration for a computer having 128 MB of RAM is shown in Table 2-9.
3. 3.Processes
4. 5.Kernel Synchronization
5. 6.Timing Measurements
6. 7.Process Scheduling
7. 8.Memory Management
8. 9.Process Address Space
9. 15.The Page Cache
10. 17.Page Frame Reclaming
11. 19.Process Communication
12. 20.Program Execution
总结
没有仔细得学习, 后面继续。
技术参考
参考文献: