麒麟系统风扇狂转可因温控策略不当、传感器异常或驱动响应错误所致,需依次验证温度与风扇状态、调整trip point阈值、切换cpufreq governor并禁用被动干预、替换thermal驱动模块、禁用tuned的thermal插件。

如果您在使用麒麟操作系统时发现系统风扇持续高速运转,即使在低负载或空闲状态下也无缓解,则可能是由于内核 thermal 子系统温控策略配置不当、传感器读数异常或冷却设备驱动未正确响应温度变化所致。以下是修复此问题的步骤:
一、验证当前温度与风扇状态
该步骤用于确认是否真实存在过热现象,还是温控逻辑误判导致风扇误启。需获取硬件实际温度值及 cooling device 当前状态,排除传感器漂移或 thermal zone 映射错误。
1、执行命令查看所有 thermal zone 温度读数:
cat /sys/class/thermal/thermal_zone*/temp
2、识别对应 CPU 或 SoC 的 thermal zone(如 thermal_zone0 通常为 CPU)并记录其数值,单位为毫摄氏度。
3、检查 cooling device 状态:
ls /sys/class/thermal/cooling_device*
4、对每个 cooling_device 执行:
cat /sys/class/thermal/cooling_device*/cur_state
cat /sys/class/thermal/cooling_device*/type
5、若 cur_state 值异常偏高(如 >3),而 temp 值低于 60000(即 60℃),则表明 cooling policy 过于激进或触发阈值设置错误。
二、调整 thermal zone 主动降温阈值
Linux 内核 thermal 框架通过 trip point(跳变点)控制 cooling device 启停。默认配置可能未适配麒麟OS硬件平台特性,需手动重设 trip point 温度阈值以避免过早触发风扇全速运行。
1、确认目标 thermal_zone 编号(例如 thermal_zone0):
ls /sys/class/thermal/
2、查看当前 trip points:
cat /sys/class/thermal/thermal_zone0/trip_point_0_temp
cat /sys/class/thermal/thermal_zone0/trip_point_1_temp
3、临时提高主动降温启动温度(以 trip_point_1 为例,对应 passive cooling):
echo 75000 | sudo tee /sys/class/thermal/thermal_zone0/trip_point_1_temp
4、若存在 trip_point_2(对应 critical shutdown),确保其不低于 95000:
echo 95000 | sudo tee /sys/class/thermal/thermal_zone0/trip_point_2_temp
5、验证修改是否生效:
cat /sys/class/thermal/thermal_zone0/trip_point_1_temp
三、切换 cpufreq governor 并禁用被动温控干预
当 thermal 子系统启用 passive cooling 时,会强制绑定 cpufreq governor 为 “powersave” 或 “ondemand”,导致 CPU 频率被频繁压制并伴随风扇持续运转。改用 “performance” 或 “schedutil” 并关闭被动干预可消除非必要降频引发的温控震荡。
1、查看当前 governor:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
2、将所有 CPU 核心 governor 统一设为 schedutil:
for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo schedutil | sudo tee $i; done
3、禁用 thermal driver 对 cpufreq 的被动干预:
echo 0 | sudo tee /sys/class/thermal/thermal_zone0/enabled
4、重启 thermal service(如已启用 systemd 管理):
sudo systemctl restart thermald
5、重新启用 thermal zone(仅限已禁用场景):
echo 1 | sudo tee /sys/class/thermal/thermal_zone0/enabled
四、替换或重载 thermal 驱动模块
部分国产化硬件平台(如基于 RK3588 或兆芯 C86 芯片组)存在 thermal 驱动兼容性缺陷,原生 acpi_thermal_rel 或 int340x_thermal 模块无法准确解析 DSDT 中的 cooling device 定义。加载适配麒麟OS的定制 thermal 驱动可恢复温度反馈闭环。
1、列出已加载 thermal 相关模块:
lsmod | grep -i thermal
2、卸载当前模块(示例为 acpi_thermal_rel):
sudo modprobe -r acpi_thermal_rel
3、加载麒麟OS认证的替代模块(路径依具体发行版而定):
sudo modprobe kylin_thermal_ko
4、确认新模块已就绪且创建了有效 thermal_zone:
ls /sys/class/thermal/ | grep -v "cooling_device"
5、若模块位于 /lib/modules/$(uname -r)/extra/ 下,执行:
sudo depmod -a && sudo update-initramfs -u
五、应用 tuned 配置集禁用动态温控插件
tuned 守护进程在某些麒麟OS版本中默认启用 thermal 插件,该插件会周期性读取温度并调用 cooling device 控制接口,与内核 thermal 子系统形成双重干预。停用该插件可避免策略冲突导致的风扇抖动。
1、查看当前 active profile:
sudo tuned-adm active
2、创建自定义 profile 复制默认 balanced 配置:
sudo cp -r /usr/lib/tuned/balanced /etc/tuned/no-thermal
3、编辑 /etc/tuned/no-thermal/tuned.conf,删除或注释包含 “thermal” 的行:
sudo sed -i '/thermal/d' /etc/tuned/no-thermal/tuned.conf
4、禁用 thermal 插件模块(在 [main] 段下添加):
echo "plugins = defaults,cpu,vm" | sudo tee -a /etc/tuned/no-thermal/tuned.conf
5、启用新 profile:
sudo tuned-adm profile no-thermal
6、确认 thermal 插件未运行:
sudo systemctl status tuned | grep -i thermal

















