随笔-处理器微架构-固定CPU频率

固定cpu频率

测试环境cpu频率管理是intel_pstate:

no_turbo.sh

#!/bin/bash

echo "disable turbo"
echo 1 | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo; echo 100 | sudo tee /sys/devices/system/cpu/intel_pstate/min_perf_pct;echo 100 | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct

sleep 1s

sudo cpufreq-info -c 0

grep "cpu MHz" /proc/cpuinfo
sudo bash no_turbo.sh

固定cpu频率 on arm

# 查看所支持的频率
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies
# 查看当前频率
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
# 查看支持的频率工作模式
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors
# 查看当前的频率工作模式
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# 或者
sudo cpufreq-info -c 7
+++
# 设置频率工作模式(正常只要设置模式,不需要设置频率)
xcpu=cpu7; echo performance | sudo tee /sys/devices/system/cpu/$xcpu/cpufreq/scaling_governor; sleep 1; cat /sys/devices/system/cpu/$xcpu/cpufreq/scaling_cur_freq
# 恢复
xcpu=cpu7; echo ondemand | sudo tee /sys/devices/system/cpu/$xcpu/cpufreq/scaling_governor
posted @   LiYanbin  阅读(12)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
点击右上角即可分享
微信分享提示