Skip to content

Commit

Permalink
DEV 22.05.09
Browse files Browse the repository at this point in the history
- 回退 混合CPU调频
- 改进 触摸响应
- 改进 CPU负载滤波器
- 修复 sdm82x部分场景CPU频率无法写入
- 修复 Exynos 2200支持
- ...合计61个commit

Signed-off-by: Matt Yang <yccy@outlook.com>
  • Loading branch information
yc9559 committed May 9, 2022
1 parent 75c8079 commit 0790439
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 53 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ https://github.com/yc9559/uperf/releases
### Magisk方式

1. 下载后通过Magisk Manager刷入,Magisk版本不低于18.0
2. 重启后查看`/sdcard/Android/yc/uperf/log_uperf.txt`检查uperf是否正常自启动
2. 重启后查看`/sdcard/Android/yc/uperf/uperf_log.txt`检查uperf是否正常自启动

### 手动安装

Expand All @@ -40,7 +40,7 @@ https://github.com/yc9559/uperf/releases
6. 打开`/data/cache/injector.log`,检查sfanalysis注入是否成功
7. 如果关联自启动到第三方APP,设置在开机完成后执行`run_uperf.sh`
8. 如果关联自启动到系统启动脚本,插入`sh /data/uperf/initsvc_uperf.sh`
9. 重启后查看`/sdcard/yc/uperf/log_uperf.txt`检查uperf是否正常自启动
9. 重启后查看`/sdcard/yc/uperf/uperf_log.txt`检查uperf是否正常自启动

### 性能模式切换

Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# 更新日志

## DEV 22.05.09

- 回退 混合CPU调频
- 改进 触摸响应
- 改进 CPU负载滤波器
- 修复 sdm82x部分场景CPU频率无法写入
- 修复 Exynos 2200支持

## DEV 22.05.04

- 新增 混合CPU调频
Expand Down
4 changes: 2 additions & 2 deletions magisk/common/system.prop
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# ro.sf.lcd_density=320

# headroom for GC
dalvik.vm.heapminfree=8m
dalvik.vm.heapmaxfree=12m
dalvik.vm.heapmaxfree=8m
dalvik.vm.heapminfree=2m
2 changes: 1 addition & 1 deletion magisk/module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=uperf
name=Uperf
version=v3(22.05.04)
version=v3(22.05.09)
versionCode=3
author=Matt Yang
description=Userspace performance controller for android. Repo: https://github.com/yc9559/uperf/
Expand Down
4 changes: 0 additions & 4 deletions magisk/script/libpowercfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ set_cpufreq_min() {
# $1:"0:576000 4:710400 7:825600"
set_cpufreq_max() {
lock_val "$1" /sys/module/msm_performance/parameters/cpu_max_freq
}

# $1:"0:576000 4:710400 7:825600"
set_cpufreq_dyn_max() {
local key
local val
for kv in $1; do
Expand Down
4 changes: 2 additions & 2 deletions magisk/script/libsysinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ get_config_name() {
"msm8998") echo "sdm835" ;;
"msm8996") echo "sdm820" ;;
"msm8996pro") echo "sdm820" ;;
"exynos2200") echo "e2200" ;;
"s5e9925") echo "e2200" ;;
"exynos2100") echo "e2100" ;;
"exynos1080") echo "e1080" ;;
"exynos990") echo "e990" ;;
"universal2200") echo "e2200" ;;
"universal9925") echo "e2200" ;;
"universal2100") echo "e2100" ;;
"universal1080") echo "e1080" ;;
"universal990") echo "e990" ;;
Expand Down
2 changes: 1 addition & 1 deletion magisk/script/powercfg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Uperf",
"author": "Matt Yang",
"version": "22.05.04",
"version": "22.05.09",
"versionCode": 3,
"features": {
"strict": true,
Expand Down
54 changes: 16 additions & 38 deletions magisk/script/powercfg_once.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ BASEDIR="$(dirname $(readlink -f "$0"))"
. $BASEDIR/libcgroup.sh

unify_cgroup() {
# clear stune & uclamp
for g in background foreground top-app; do
lock_val "0" /dev/stune/$g/schedtune.sched_boost_no_override
lock_val "0" /dev/stune/$g/schedtune.boost
lock_val "0" /dev/stune/$g/schedtune.prefer_idle
lock_val "0" /dev/cpuctl/$g/cpu.uclamp.sched_boost_no_override
lock_val "0" /dev/cpuctl/$g/cpu.uclamp.min
lock_val "0" /dev/cpuctl/$g/cpu.uclamp.latency_sensitive
done

# clear top-app
for cg in cpuset stune cpuctl; do
for p in $(cat /dev/$cg/top-app/tasks); do
Expand All @@ -48,11 +38,10 @@ unify_cgroup() {
change_task_cgroup "surfaceflinger" "foreground" "cpuset"
change_thread_cgroup "surfaceflinger" "^Binder" "" "cpuset"
change_task_cgroup "system_server" "foreground" "cpuset"
change_thread_cgroup "system_server" "^Binder" "" "cpuset"
change_thread_cgroup "system_server" "^android.bg" "" "cpuset"
change_task_cgroup "composer|allocator" "foreground" "cpuset"
change_task_cgroup "android.hardware.media" "top-app" "cpuset"
change_task_cgroup "netd" "foreground" "cpuset"
change_task_cgroup "android.hardware.media" "background" "cpuset"
change_task_cgroup "vendor.mediatek.hardware" "background" "cpuset"
change_task_cgroup "aal_sof|kfps|dsp_send_thread|vdec_ipi_recv|mtk_drm_disp_id|hif_thread|main_thread|ged_" "background" "cpuset"
change_task_cgroup "pp_event|crtc_" "background" "cpuset"
Expand All @@ -64,25 +53,17 @@ unify_sched() {
done
}

unify_cpufreq() {
# unify hmp interactive governor, only 2+2 4+2 4+4
set_governor_param "interactive/use_sched_load" "0:1 2:1 4:1"
set_governor_param "interactive/use_migration_notif" "0:1 2:1 4:1"
set_governor_param "interactive/enable_prediction" "0:1 2:1 4:1"
set_governor_param "interactive/ignore_hispeed_on_notif" "0:1 2:1 4:1"
set_governor_param "interactive/fast_ramp_down" "0:0 2:0 4:0"
set_governor_param "interactive/boostpulse_duration" "0:0 2:0 4:0"
set_governor_param "interactive/boost" "0:0 2:0 4:0"
set_governor_param "interactive/above_hispeed_delay" "0:0 2:0 4:0"
set_governor_param "interactive/hispeed_freq" "0:0 2:0 4:0"
set_governor_param "interactive/go_hispeed_load" "0:90 2:90 4:90"
set_governor_param "interactive/target_loads" "0:80 2:80 4:80"
set_governor_param "interactive/min_sample_time" "0:0 2:0 4:0"
set_governor_param "interactive/max_freq_hysteresis" "0:0 2:0 4:0"
}

unify_devfreq() {
mutate "9999000000" "/sys/class/devfreq/*/max_freq"
for d in /sys/class/devfreq/*; do
local maxfreq="0"
for f in $(cat $d/available_frequencies); do
[ "$f" -gt "$maxfreq" ] && maxfreq="$f"
done
[ "$maxfreq" -gt "0" ] && mutate "$maxfreq" "$d/max_freq"
done
for d in DDR LLCC L3; do
mutate "9999000000" "/sys/devices/system/cpu/bus_dcvs/$d/*/max_freq"
done
}

disable_hotplug() {
Expand Down Expand Up @@ -116,12 +97,9 @@ disable_kernel_boost() {
lock_val "0" "/sys/devices/system/cpu/cpu_boost/parameters/*"
lock_val "0" "/sys/module/cpu_boost/parameters/*"
lock_val "0" "/sys/module/msm_performance/parameters/*"
lock_val "0" "/sys/kernel/msm_performance/parameters/*"
lock_val "0" "/proc/sys/walt/input_boost/*"

# no msm_performance limit
set_cpufreq_min "0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0"
set_cpufreq_max "0:9999000 1:9999000 2:9999000 3:9999000 4:9999000 5:9999000 6:9999000 7:9999000"

# MediaTek
# policy_status
# [0] PPM_POLICY_PTPOD: Meature PMIC buck currents
Expand Down Expand Up @@ -186,6 +164,7 @@ disable_userspace_boost() {
lock_val "0" "/sys/module/fbt_cpu/parameters/boost_affinity*"
lock_val "0" /sys/kernel/fpsgo/fbt/switch_idleprefer
lock_val "1" /proc/perfmgr/syslimiter/syslimiter_force_disable
# lock_val "1" /sys/module/mtk_core_ctl/parameters/policy_enable

# Qualcomm&MTK perfhal
perfhal_stop
Expand All @@ -211,11 +190,12 @@ restart_userspace_boost() {
}

disable_userspace_thermal() {
# yes, let it respawn
killall mi_thermald
# prohibit mi_thermald use cpu thermal interface
for i in 0 2 4 6 7; do
lock_val "cpu$i 9999999" /sys/devices/virtual/thermal/thermal_message/cpu_limits
lock_val "cpu$i 9999000" /sys/devices/virtual/thermal/thermal_message/cpu_limits
done
chmod 0444 /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq
}

restart_userspace_thermal() {
Expand All @@ -233,7 +213,6 @@ echo "sh=$(which sh)"
disable_kernel_boost
disable_hotplug
unify_sched
unify_cpufreq
unify_devfreq

disable_userspace_thermal
Expand All @@ -245,7 +224,6 @@ restart_userspace_boost
disable_kernel_boost
disable_hotplug
unify_sched
unify_cpufreq
unify_devfreq

# make sure that all the related cpu is online
Expand Down
2 changes: 1 addition & 1 deletion magisk/script/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ install_uperf() {
echo ""
echo "* Uperf https://github.com/yc9559/uperf/"
echo "* Author: Matt Yang"
echo "* Version: v3(22.05.04)"
echo "* Version: v3(22.05.09)"
echo ""

echo "- Installing uperf"
Expand Down
4 changes: 2 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"versionCode": 3,
"version": "v3(22.05.04)",
"zipUrl": "https://github.com/yc9559/uperf/releases/download/dev-22.05.04/uperf-dev-22.05.04.zip",
"version": "v3(22.05.09)",
"zipUrl": "https://github.com/yc9559/uperf/releases/download/dev-22.05.09/uperf-dev-22.05.09.zip",
"changelog": "https://github.com/yc9559/uperf/raw/master/changelog.md"
}

0 comments on commit 0790439

Please sign in to comment.