> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man9/pmap_remove.9.md).

# pmap\_remove.9

`pmap_remove` — 从物理映射中移除页面

## 名称

`pmap_remove`, `pmap_remove_all`, `pmap_remove_pages`

## 概要

```c
#include <sys/param.h>
```

```c
#include <vm/vm.h>
```

```c
#include <vm/pmap.h>
```

```c
void
pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)

void
pmap_remove_all(vm_page_t m)

void
pmap_remove_pages(pmap_t pmap)
```

## 描述

`pmap_remove` 函数从物理映射 `pmap` 中移除介于 `sva` 和 `eva` 之间的地址范围。如果 `eva` 小于 `sva`，则结果未定义。假定 `sva` 和 `eva` 均为页对齐地址。

`pmap_remove_all` 从所有包含物理页 `m` 的物理映射中移除该物理页，并将修改位反映回相应的 pager。

`pmap_remove_pages` 函数从物理映射 `pmap` 中移除所有用户页面。该函数在进程退出时调用，以比调用 `pmap_remove` 更快地回收其地址空间。

## 参见

[pmap(9)](/man/man9/pmap.9.md)

## 作者

本手册页由 Bruce M Simpson <bms@spc.org> 编写。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man9/pmap_remove.9.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
