Documentation/translations/zh_CN/mm/free_page_reporting.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/mm/free_page_reporting.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/mm/free_page_reporting.rst- Extension
.rst- Size
- 1778 bytes
- Lines
- 39
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. include:: ../disclaimer-zh_CN.rst
:Original: Documentation/mm/free_page_reporting.rst
:翻译:
司延腾 Yanteng Si <siyanteng@loongson.cn>
:校译:
==========
空闲页报告
==========
空闲页报告是一个API,设备可以通过它来注册接收系统当前未使用的页面列表。这在虚拟
化的情况下是很有用的,客户机能够使用这些数据来通知管理器它不再使用内存中的某些页
面。
对于驱动,通常是气球驱动要使用这个功能,它将分配和初始化一个page_reporting_dev_info
结构体。它要填充的结构体中的字段是用于处理散点列表的 "report" 函数指针。它还必
须保证每次调用该函数时能处理至少相当于PAGE_REPORTING_CAPACITY的散点列表条目。
假设没有其他页面报告设备已经注册, 对page_reporting_register的调用将向报告框
架注册页面报告接口。
一旦注册,页面报告API将开始向驱动报告成批的页面。API将在接口被注册后2秒开始报告
页面,并在任何足够高的页面被释放之后2秒继续报告。
报告的页面将被存储在传递给报告函数的散列表中,最后一个条目的结束位被设置在条目
nent-1中。 当页面被报告函数处理时,分配器将无法访问它们。一旦报告函数完成,这些
页将被返回到它们所获得的自由区域。
在移除使用空闲页报告的驱动之前,有必要调用page_reporting_unregister,以移除
目前被空闲页报告使用的page_reporting_dev_info结构体。这样做将阻止进一步的报
告通过该接口发出。如果另一个驱动或同一驱动被注册,它就有可能恢复前一个驱动在报告
空闲页方面的工作。
Alexander Duyck, 2019年12月04日
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.