点击打开链接

[plain] view plain copy
  1. stop thermald
  2. stop mpdecision
  3. stop thermal-engine
  4. # online A57
  5. echo 1 > /sys/devices/system/cpu/cpu2/online
  6. echo 1 > /sys/devices/system/cpu/cpu3/online
  7. echo 1 > /sys/devices/system/cpu/cpu4/online
  8. echo 1 > /sys/devices/system/cpu/cpu5/online
  9. echo 1 > /sys/devices/system/cpu/cpu6/online
  10. echo 1 > /sys/devices/system/cpu/cpu7/online
  11. # set governor
  12. echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  13. echo performance > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
  14. # set max freq
  15. echo 1555200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  16. echo 1958400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq
  17. # set gpu
  18. echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
  19. echo 0 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel
  20. echo performance > /sys/class/devfreq/qcom,cpubw.32/governor
  21. echo performance > /sys/class/devfreq/qcom,gpubw.71/governor
  22. echo performance > /sys/class/devfreq/qcom,kgsl-busmon.70/governor

cpu0会一直在线,因此不用手动online。

8994的cpu频率是按簇调整的,因此只需要设置cpu0和cpu4的performance。

拉起来的瞬间可能会触发bcl的调频和拔核动作,全部拉起来后可能温度过高导致thermal降频及拔核。

另外,vendor/qcom/proprietary/Android-perf/core-ctl/core_ctl.c的某些代码可能会引起拉核失败或者拉上来后又被这个模块给down了,需要做如下修改:

将753行cpu_callback()的CPU_UP_PREPARE分支里的如下判断改成if(0),这可以防止拉核失败:

高通msm8994手动提升性能脚本-LMLPHP

将该文件try_hotplug()函数里的do_hotplug()取消掉,可以防止该模块又把拉上来的cpu给offline了。

不过如此修改代码后,需要手动降低性能:

[plain] view plain copy
  1. #offline A57
  2. echo 0 > /sys/devices/system/cpu/cpu4/online
  3. echo 0 > /sys/devices/system/cpu/cpu5/online
  4. echo 0 > /sys/devices/system/cpu/cpu6/online
  5. echo 0 > /sys/devices/system/cpu/cpu7/online
  6. # down max freq
  7. echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  8. echo simple_ondemand > /sys/class/kgsl/kgsl-3d0/devfreq/governor
  9. echo 5 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel

[plain] view plain copy
  1. stop thermald
  2. stop mpdecision
  3. stop thermal-engine
  4. # online A57
  5. echo 1 > /sys/devices/system/cpu/cpu2/online
  6. echo 1 > /sys/devices/system/cpu/cpu3/online
  7. echo 1 > /sys/devices/system/cpu/cpu4/online
  8. echo 1 > /sys/devices/system/cpu/cpu5/online
  9. echo 1 > /sys/devices/system/cpu/cpu6/online
  10. echo 1 > /sys/devices/system/cpu/cpu7/online
  11. # set governor
  12. echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  13. echo performance > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
  14. # set max freq
  15. echo 1555200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  16. echo 1958400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq
  17. # set gpu
  18. echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
  19. echo 0 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel
  20. echo performance > /sys/class/devfreq/qcom,cpubw.32/governor
  21. echo performance > /sys/class/devfreq/qcom,gpubw.71/governor
  22. echo performance > /sys/class/devfreq/qcom,kgsl-busmon.70/governor

cpu0会一直在线,因此不用手动online。

8994的cpu频率是按簇调整的,因此只需要设置cpu0和cpu4的performance。

拉起来的瞬间可能会触发bcl的调频和拔核动作,全部拉起来后可能温度过高导致thermal降频及拔核。

另外,vendor/qcom/proprietary/Android-perf/core-ctl/core_ctl.c的某些代码可能会引起拉核失败或者拉上来后又被这个模块给down了,需要做如下修改:

将753行cpu_callback()的CPU_UP_PREPARE分支里的如下判断改成if(0),这可以防止拉核失败:

高通msm8994手动提升性能脚本-LMLPHP

将该文件try_hotplug()函数里的do_hotplug()取消掉,可以防止该模块又把拉上来的cpu给offline了。

不过如此修改代码后,需要手动降低性能:

[plain] view plain copy
  1. #offline A57
  2. echo 0 > /sys/devices/system/cpu/cpu4/online
  3. echo 0 > /sys/devices/system/cpu/cpu5/online
  4. echo 0 > /sys/devices/system/cpu/cpu6/online
  5. echo 0 > /sys/devices/system/cpu/cpu7/online
  6. # down max freq
  7. echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  8. echo simple_ondemand > /sys/class/kgsl/kgsl-3d0/devfreq/governor
  9. echo 5 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel

05-01 05:57