-
root@localhost:/sys/devices/system/cpu/cpufreq# lscpu
-
Architecture: aarch64
-
Byte Order: Little Endian
-
CPU(s): 2
-
On-line CPU(s) list: 0,1
-
Thread(s) per core: 1
-
Core(s) per socket: 2
-
Socket(s): 1
-
NUMA node(s): 1
-
Vendor ID: ARM
-
Model: 3
-
Model name: Cortex-A72
-
Stepping: r0p3
-
CPU max MHz: 1500.0000
-
CPU min MHz: 300.0000
-
BogoMIPS: 50.00
-
L1d cache: unknown size
-
L1i cache: unknown size
-
L2 cache: unknown size
-
NUMA node0 CPU(s): 0,1
-
Flags: fp asimd evtstrm crc32 cpuid
-
复制代码
如果想使用其它策略,以高性能模式为例,返回根目率,可以进行如下设置,root@forlinx:/# systemctl disable ondemand.service
root@forlinx:/# apt-get install cpufrequtils
修改
root@forlinx:/# vi /etc/default/cpufrequtils
添加
GOVERNOR="performance"
重启测试
root@forlinx:/# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
performance
实际过程cpu1、cpu2、cpu3会同时改变。
— CPU默认调度策略
策略初始化注册完之后,会开一个定时器,周期检测系统负载变化来动态调节频率,流程如下:
cpufreq_interactive_timer -> //timer会被定期执行计算当前系统负载
wake_up_process(speedchange_task) -> //唤醒负载计算线程
cpufreq_interactive_speedchange_task ->
__cpufreq_driver_target ->
cpufreq_driver->target ->
cpufreq_target -> rockchip-cpufreq.c
cpufreq_frequency_table_target //设置的target freq要在policy的运行范围内
dvfs_clk_set_rate->
clk_dvfs_node->vd->vd_dvfs_target ->
dvfs_target ->
dvfs_get_limit_rate//这里会判断温度的litmit值(temp_limit_rate变量)
clk_set_rate