# 3.2 物理内存

本节我们将主要介绍内核如何管理物理内存，首先我们将介绍与之相关的重要数据结构，这些数据结构的关系体现了内核管理物理内存的基本思路。组织管理好物理内存的目的是为了更高效、合理地使用内存，然而在内存不断分配与释放的过程中我们将面临很多问题，最大的问题之一是内存的碎片化，本节我们将介绍内核如何使用Buddy System算法有效降低内存使用过程中的碎片率。另外，效率是内核永恒的话题，我们还将介绍内核如何通过 slab/slob/slub 来提升对内存的使用效率。

内存管理模块非常复杂，本节的目的是梳理出内核在内存管理上的总体设计思路，因此不会深入每个场景的细节之中（例如内存的初始化流程），但我们会对关键部分的主要函数进行分析，以便为读者搭建起总体的知识框架。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://s3.shizhz.me/linux-mm/3.2-wu-li-nei-cun.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
