요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
===================================================
Firmware support for CPU hotplug under Linux/x86-64
===================================================
Linux/x86-64 supports CPU hotplug now. For various reasons Linux wants to
know in advance of boot time the maximum number of CPUs that could be plugged
into the system. ACPI 3.0 currently has no official way to supply
this information from the firmware to the operating system.
In ACPI each CPU needs an LAPIC object in the MADT table (5.2.11.5 in the
ACPI 3.0 specification). ACPI already has the concept of disabled LAPIC
objects by setting the Enabled bit in the LAPIC object to zero.
For CPU hotplug Linux/x86-64 expects now that any possible future hotpluggable
CPU is already available in the MADT. If the CPU is not available yet
it should have its LAPIC Enabled bit set to 0. Linux will use the number
of disabled LAPICs to compute the maximum number of future CPUs.
In the worst case the user can overwrite this choice using a command line
option (additional_cpus=...), but it is recommended to supply the correct
number (or a reasonable approximation of it, with erring towards more not less)
in the MADT to avoid manual configuration.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
CPU hotplug firmware 요구 배경
1-15이 문서는 `SPDX-License-Identifier: GPL-2.0`으로 배포됩니다. Linux/x86-64는 CPU hotplug를 지원하며 여러 이유로 boot 전에 system에 hotplug할 수 있는 최대 CPU 수를 알아야 합니다. ACPI 3.0에는 firmware가 이 정보를 operating system에 전달하는 공식 방법이 없습니다.
ACPI에서 각 CPU는 MADT table의 LAPIC object가 필요합니다. ACPI 3.0 specification의 section `5.2.11.5`에 해당합니다. LAPIC object의 Enabled bit를 0으로 설정해 비활성 LAPIC를 표현하는 개념은 이미 존재합니다.
MADT disabled LAPIC 규칙
16-24CPU hotplug를 위해 Linux/x86-64는 미래에 hotplug될 가능성이 있는 모든 CPU가 MADT에 미리 존재하기를 요구합니다. CPU가 아직 사용 가능하지 않다면 LAPIC Enabled bit를 0으로 설정해야 합니다. Linux는 disabled LAPIC 수로 미래의 최대 CPU 수를 계산합니다.
최악의 경우 사용자가 `additional_cpus=...` command-line option으로 이 선택을 덮어쓸 수 있습니다. 하지만 수동 구성을 피하려면 MADT가 올바른 수 또는 합리적인 근삿값을 제공하는 것이 좋으며, 적게 잡기보다 많게 잡는 편이 낫습니다.
요약과 해설
cpu-hotplug-spec.rst:1-24firmware는 미래에 장착될 수 있는 CPU도 MADT에 LAPIC object로 미리 넣고 아직 없는 CPU의 Enabled bit를 0으로 설정해야 합니다.
Linux는 disabled LAPIC 수로 최대 CPU 수를 계산하며 `additional_cpus=...`는 예외적인 수동 override입니다.