CPU 与调度60 条

cpufreq 调频调速器

governor 决定 CPU 频率如何随负载变化:performance 恒高频、powersave 最低频、schedutil 由调度器驱动;低延迟场景常固定 performance。

查询cpupower frequency-info / scaling_governor
常见值performance / powersave / schedutil / ondemand
设置依次写入各 cpu 的 scaling_governor

查看与固定

查看与固定
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cpupower frequency-info --governors
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

易错点

  • 虚拟机通常不暴露宿主的调频能力,写文件可能报 No such file
  • BIOS/固件的电源策略可能覆盖内核设置,OS 侧改完需实测频率验证

数据来源与参考

  • Linux 内核 Documentation/admin-guide/pm/cpufreq.rst
  • cpupower 手册
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌