Documentation/translations/zh_CN/mm/hwpoison.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/mm/hwpoison.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/mm/hwpoison.rst- Extension
.rst- Size
- 5826 bytes
- Lines
- 167
- 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
:Original: Documentation/mm/hwpoison.rst
:翻译:
司延腾 Yanteng Si <siyanteng@loongson.cn>
:校译:
========
hwpoison
========
什么是hwpoison?
===============
即将推出的英特尔CPU支持从一些内存错误中恢复( ``MCA恢复`` )。这需要操作系统宣布
一个页面"poisoned",杀死与之相关的进程,并避免在未来使用它。
这个补丁包在虚拟机中实现了必要的(编程)框架。
引用概述中的评论::
高级机器的检查与处理。处理方法是损坏的页面被硬件报告,通常是由于2位ECC内
存或高速缓存故障。
这主要是针对在后台检测到的损坏的页面。当当前的CPU试图访问它时,当前运行的进程
可以直接被杀死。因为还没有访问损坏的页面, 如果错误由于某种原因不能被处理,就可
以安全地忽略它. 而不是用另外一个机器检查去处理它。
处理不同状态的页面缓存页。这里棘手的部分是,相对于其他虚拟内存用户, 我们可以异
步访问任何页面。因为内存故障可能随时随地发生,可能违反了他们的一些假设。这就是
为什么这段代码必须非常小心。一般来说,它试图使用正常的锁规则,如获得标准锁,即使
这意味着错误处理可能需要很长的时间。
这里的一些操作有点低效,并且具有非线性的算法复杂性,因为数据结构没有针对这种情
况进行优化。特别是从vma到进程的映射就是这种情况。由于这种情况大概率是罕见的,所
以我们希望我们可以摆脱这种情况。
该代码由mm/memory-failure.c中的高级处理程序、一个新的页面poison位和虚拟机中的
各种检查组成,用来处理poison的页面。
现在主要目标是KVM客户机,但它适用于所有类型的应用程序。支持KVM需要最近的qemu-kvm
版本。
对于KVM的使用,需要一个新的信号类型,这样KVM就可以用适当的地址将机器检查注入到客户
机中。这在理论上也允许其他应用程序处理内存故障。我们的期望是,所有的应用程序都不要这
样做,但一些非常专业的应用程序可能会这样做。
故障恢复模式
============
有两种(实际上是三种)模式的内存故障恢复可以在。
vm.memory_failure_recovery sysctl 置零:
所有的内存故障都会导致panic。请不要尝试恢复。
早期处理
(可以在全局和每个进程中控制) 一旦检测到错误,立即向应用程序发送SIGBUS这允许
应用程序以温和的方式处理内存错误(例如,放弃受影响的对象) 这是KVM qemu使用的
模式。
推迟处理
当应用程序运行到损坏的页面时,发送SIGBUS。这对不知道内存错误的应用程序来说是
最好的,默认情况下注意一些页面总是被当作late kill处理。
用户控制
========
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.