v1 2026-10-18

加速大规模系统CPU热插拔 · v1

优化CPU批量上线/下线路径,涵盖x86、调度拓扑、deadline带宽和vmstat,加速live update。

原始补丁链接

子 Patch(8)

1/8
x86/realmode: Remove unnecessary WBINVD from AP startup trampoline
trampoline_start executes WBINVD in 16-bit real mode before switching to protected mode. This WBINVD was originally added in the 1990s for Sequent NUMA-Q hardware (as noted by the comment in trampolin
2/8
x86/smp: Remove unnecessary WBINVD from mwait_play_dead()
When a logical CPU goes offline via mwait_play_dead(), it executes WBINVD before entering the MWAIT loop. On processors with large shared last-level caches (such as Intel Xeon 6985P-C with 504 MB L3 p
3/8
x86/mce/intel: Bound cmci_rediscover() to a single topology peer
When a CPU goes offline, cmci_clear() disables CMCI on any MCA banks owned by that CPU, and mce_cpu_dead() calls cmci_rediscover(). Currently cmci_rediscover() invokes on_each_cpu(cmci_rediscover_work
4/8
x86/cacheinfo, mtrr: Skip stop_machine rendezvous in cache_ap_online() when MTRRs match
When a single CPU is brought online at runtime (cache_aps_delayed_init == false), cache_ap_online() unconditionally calls stop_machine_from_inactive_cpu() to rendezvous all online CPUs while the incom
5/8
sched/topology: Avoid redundant O(N^3) group capacity walks and unused allocations in build_sched_domains()
During sequential CPU hotplug on large systems, build_sched_domains() is invoked for every CPU offline and online step. Two bottlenecks in the domain construction path scale poorly with CPU count: 1.
6/8
sched/deadline, topology: Avoid O(N^2) dl_server bandwidth walks during root_domain rebuilds
Every CPU runqueue has a fair_server (and optionally an ext_server) deadline entity enabled by default. Whenever a root_domain is rebuilt on CPU hotplug or cpuset changes, partition_sched_domains_lock
7/8
sched/topology: Avoid redundant percpu allocations and bitmap walks in build_sched_domains()
During CPU hotplug, build_sched_domains() is invoked on every CPU activation and deactivation. Profiling build_sched_domains() on a 480-CPU Intel Xeon 6985P-C and a 512-CPU AMD EPYC 9B45 shows several
8/8
mm/vmstat: Avoid redundant per-CPU stat_threshold writes in refresh_zone_stat_thresholds()
During CPU hotplug, vmstat_cpu_online() and vmstat_cpu_dead() invoke refresh_zone_stat_thresholds() on every CPU transition. Currently, refresh_zone_stat_thresholds() first zeroes per_cpu_nodestats->s