Documentation/translations/zh_CN/core-api/cpu_hotplug.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/core-api/cpu_hotplug.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/core-api/cpu_hotplug.rst- Extension
.rst- Size
- 26995 bytes
- Lines
- 662
- 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/core-api/cpu_hotplug.rst
:翻译:
司延腾 Yanteng Si <siyanteng@loongson.cn>
周彬彬 Binbin Zhou <zhoubinbin@loongson.cn>
:校译:
吴想成 Wu XiangCheng <bobwxc@email.cn>
.. _cn_core_api_cpu_hotplug:
=================
内核中的CPU热拔插
=================
:时间: 2021年9月
:作者: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Rusty Russell <rusty@rustcorp.com.au>,
Srivatsa Vaddagiri <vatsa@in.ibm.com>,
Ashok Raj <ashok.raj@intel.com>,
Joel Schopp <jschopp@austin.ibm.com>,
Thomas Gleixner <tglx@kernel.org>
简介
====
现代系统架构的演进已经在处理器中引入了先进的错误报告和纠正能力。有一些OEM也支
持可热拔插的NUMA(Non Uniform Memory Access,非统一内存访问)硬件,其中物理
节点的插入和移除需要支持CPU热插拔。
这样的进步要求内核可用的CPU被移除,要么是出于配置的原因,要么是出于RAS的目的,
以保持一个不需要的CPU不在系统执行路径。因此需要在Linux内核中支持CPU热拔插。
CPU热拔插支持的一个更新颖的用途是它在SMP的暂停恢复支持中的应用。双核和超线程支
持使得即使是笔记本电脑也能运行不支持这些方法的SMP内核。
命令行开关
==========
``maxcpus=n``
限制启动时的CPU为 *n* 个。例如,如果你有四个CPU,使用 ``maxcpus=2`` 将只能启
动两个。你可以选择稍后让其他CPU上线。
``nr_cpus=n``
限制内核将支持的CPU总量。如果这里提供的数量低于实际可用的CPU数量,那么其他CPU
以后就不能上线了。
``possible_cpus=n``
这个选项设置 ``cpu_possible_mask`` 中的 ``possible_cpus`` 位。
这个选项只限于X86和S390架构。
``cpu0_hotplug``
允许关闭CPU0。
这个选项只限于X86架构。
CPU位图
=======
``cpu_possible_mask``
系统中可能可用CPU的位图。这是用来为per_cpu变量分配一些启动时的内存,这些变量
不会随着CPU的可用或移除而增加/减少。一旦在启动时的发现阶段被设置,该映射就是静态
的,也就是说,任何时候都不会增加或删除任何位。根据你的系统需求提前准确地调整它
可以节省一些启动时的内存。
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.