Skip to content

Commit

Permalink
DEV 20200414
Browse files Browse the repository at this point in the history
uperf:添加AffinityHelper固定高优先级的UX线程到大核,并减少低优先级线程的性能需求响应
uperf:由于CPU核心热插拔,取消缓存cpufreq的fd
uperf:写入器始终动态申请fd,测试是否因为缓存fd导致睡死
uperf:修复一处可能的空指针引用
uperf:移除不再使用的HintRotation
wipev2:openga适配器:sdm625和sdm820使用平衡型负载迁移
wipev2:CPU模型:限制sdm821 v2 v3的小核最大频率为1.59ghz
wipev2:Uperf:在渲染结束后至多300ms,或者触摸停止后3000ms,停止hint
配置文件生成器:开启EAS和HMP平台的ux affinity,stune方式依赖层次不齐的EAS实现
配置文件生成器:修复845的l3LatBig和ddrLatBig路径错误
配置文件生成器:增加msm8939 615/616支持
配置文件生成器:修复8895 eas最低频设置
once:补上stop perfd
once:上调内核的inotify事件数量限制
安装脚本:再次尝试支持exynos 982x

Signed-off-by: Matt Yang <[email protected]>
  • Loading branch information
yc9559 committed Apr 14, 2020
1 parent 40c2061 commit 598b54a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
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=DEV 20200411
version=DEV 20200414
versionCode=1
author=Matt Yang
description=Userspace performance controller for android. Repo: https://github.com/yc9559/uperf/
Expand Down
9 changes: 7 additions & 2 deletions magisk/script/libuperf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Uperf Library
# https://github.com/yc9559/
# Author: Matt Yang
# Version: 20200411
# Version: 20200413

BASEDIR="$(dirname "$0")"
. $BASEDIR/pathinfo.sh
Expand Down Expand Up @@ -49,7 +49,12 @@ uperf_start()
{
# CANNOT LINK EXECUTABLE ".../bin/uperf": "/apex/com.android.runtime/lib64/libc++.so" is 64-bit instead of 32-bit
# ...because LD_LIBRARY_PATH=":/apex/com.android.runtime/lib64"
LD_LIBRARY_PATH=""
# LD_LIBRARY_PATH=""

# raise inotify limit
lock_val "131072" /proc/sys/fs/inotify/max_queued_events
lock_val "131072" /proc/sys/fs/inotify/max_user_watches
lock_val "1024" /proc/sys/fs/inotify/max_user_instances

# pretend to be system binary
local uperf_bin_path
Expand Down
2 changes: 1 addition & 1 deletion magisk/script/powercfg_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ save_panel()
write_panel ""
write_panel "Uperf https://github.com/yc9559/uperf/"
write_panel "Author: Matt Yang"
write_panel "Version: DEV 20200411"
write_panel "Version: DEV 20200414"
write_panel "Last performed: $(date '+%Y-%m-%d %H:%M:%S')"
write_panel ""
write_panel "[Uperf status]"
Expand Down
42 changes: 23 additions & 19 deletions magisk/script/powercfg_once.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ BASEDIR="$(dirname "$0")"

# unify schedtune misc
# android 10 doesn't have schedtune.sched_boost_enabled exposed, default = true
lock_val "0" $ST_BACK/schedtune.boost
lock_val "0" $ST_BACK/schedtune.prefer_idle
lock_val "0" $ST_FORE/schedtune.boost
lock_val "0" $ST_FORE/schedtune.prefer_idle
lock_val "0" $ST_TOP/schedtune.boost
lock_val "0" $ST_TOP/schedtune.prefer_idle
mutate "0" $ST_BACK/schedtune.boost
mutate "0" $ST_BACK/schedtune.prefer_idle
mutate "0" $ST_FORE/schedtune.boost
mutate "0" $ST_FORE/schedtune.prefer_idle
mutate "0" $ST_TOP/schedtune.boost
mutate "0" $ST_TOP/schedtune.prefer_idle

# CFQ io scheduler takes cgroup into consideration
lock_val "cfq" $SDA_Q/scheduler
Expand Down Expand Up @@ -67,6 +67,8 @@ change_proc_cgroup "system_server" "foreground" "stune"
change_thread_cgroup "system_server" "android.anim" "top-app" "stune"
change_thread_cgroup "system_server" "android.anim.lf" "top-app" "stune"
change_thread_cgroup "system_server" "android.ui" "top-app" "stune"
# ...and pin HeapTaskDaemon on LITTLE
change_thread_cgroup "system_server" "HeapTaskDaemon" "background" "cpuset"

# reduce big cluster wakeup, eg. [email protected]
change_task_cgroup ".hardware." "background" "cpuset"
Expand All @@ -82,8 +84,8 @@ change_task_affinity ".hardware.display" "ff"
# provide best performance for fingerprint service
change_task_cgroup ".hardware.biometrics.fingerprint" "rt" "stune"
change_task_nice ".hardware.biometrics.fingerprint" "-20"
lock_val "100" $ST_RT/schedtune.boost
lock_val "1" $ST_RT/schedtune.prefer_idle
mutate "100" $ST_RT/schedtune.boost
mutate "1" $ST_RT/schedtune.prefer_idle

# try to disable all kernel input boost
# Qualcomm
Expand All @@ -96,17 +98,17 @@ lock_val "0" /sys/module/cpu_boost/parameters/boost_ms
lock_val "0" /sys/power/pnpmgr/touch_boost
lock_val "0" /sys/power/pnpmgr/long_duration_touch_boost
# Samsung
lock_val "0" /sys/class/input_booster/level
lock_val "0" /sys/class/input_booster/head
lock_val "0" /sys/class/input_booster/tail
mutate "0" /sys/class/input_booster/level
mutate "0" /sys/class/input_booster/head
mutate "0" /sys/class/input_booster/tail
# Samsung EPIC interfaces
# lock_val "0" /dev/cluster0_freq_min
# lock_val "0" /dev/cluster1_freq_min
# lock_val "0" /dev/cluster2_freq_min
mutate "0" /dev/cluster0_freq_min
mutate "0" /dev/cluster1_freq_min
mutate "0" /dev/cluster2_freq_min
# lock_val "0" /dev/bus_throughput
# lock_val "0" /dev/gpu_freq_min
# Samsung /kernel/sched/ems/...
# lock_val "0" /sys/kernel/ems/eff_mode
mutate "0" /sys/kernel/ems/eff_mode
# 3rd
lock_val "0" /sys/kernel/cpu_input_boost/enabled
lock_val "0" /sys/kernel/cpu_input_boost/ib_freqs
Expand Down Expand Up @@ -138,6 +140,8 @@ lock_val "0" /sys/module/cpu_input_boost/parameters/flex_boost_freq_hp
lock_val "0" /sys/module/cpu_input_boost/parameters/flex_boost_freq_lp
lock_val "0" /sys/module/devfreq_boost/parameters/input_boost_duration

# stop qualcomm perfd
stop perfd
# stop qualcomm perfd
perfhal_stop
# brain service maybe not smart
Expand All @@ -150,14 +154,14 @@ stop oneplus_brain_service
# stop vendor.power-hal-1-3

# Exynos hotplug
lock_val "0" /sys/power/cpuhotplug/enabled
lock_val "0" $CPU/cpuhotplug/enabled
mutate "0" /sys/power/cpuhotplug/enabled
mutate "0" $CPU/cpuhotplug/enabled
# turn off msm_thermal
lock_val "0" /sys/module/msm_thermal/core_control/enabled
lock_val "N" /sys/module/msm_thermal/parameters/enabled
# bring all cores online
for i in 0 1 2 3 4 5 6 7 8 9; do
lock_val "1" $CPU/cpu$i/online
mutate "1" $CPU/cpu$i/online
done

# no msm_performance limit
Expand Down Expand Up @@ -207,7 +211,7 @@ lock_val "1" $SCHED/sched_prefer_sync_wakee_to_waker
lock_val "200000" $SCHED/sched_freq_inc_notify
lock_val "400000" $SCHED/sched_freq_dec_notify
# place a little heavier processes on big cluster, due to Cortex-A55 poor efficiency
set_sched_migrate "80 90" "40 45" "120" "100"
set_sched_migrate "80 90" "60 45" "120" "100"
# prefer to use prev cpu, decrease jitter from 0.5ms to 0.3ms with lpm settings
lock_val "30000000" $SCHED/sched_migration_cost_ns
# OnePlus opchain pins UX threads on the big cluster
Expand Down
9 changes: 5 additions & 4 deletions magisk/setup_uperf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Uperf Setup
# https://github.com/yc9559/
# Author: Matt Yang & cjybyjk ([email protected])
# Version: 20200411
# Version: 20200414

BASEDIR="$(dirname $(readlink -f "$0"))"

Expand Down Expand Up @@ -212,6 +212,7 @@ _get_cfgname()
"lito") ret="sdm765" ;;
"sm6150") ret="$(_get_sm6150_type)" ;;
"sdm710") ret="sdm710" ;;
"msm8939") ret="sdm616" ;;
"msm8953") ret="$(_get_sdm625_type)" ;;
"msm8953pro") ret="$(_get_sdm626_type)" ;;
"sdm660") ret="$(_get_sdm660_type)" ;;
Expand All @@ -222,8 +223,8 @@ _get_cfgname()
"msm8998") ret="$(_get_sdm835_type)" ;;
"msm8996") ret="$(_get_sdm82x_type)" ;;
"msm8996pro") ret="$(_get_sdm82x_type)" ;;
# "universal9825") ret="e9820" ;;
# "universal9820") ret="e9820" ;;
"universal9825") ret="e9820" ;;
"universal9820") ret="e9820" ;;
"universal9810") ret="e9810" ;;
"universal8895") ret="$(_get_e8895_type)" ;;
"universal8890") ret="e8890" ;;
Expand All @@ -238,7 +239,7 @@ uperf_print_banner()
echo ""
echo "* Uperf https://github.com/yc9559/uperf/"
echo "* Author: Matt Yang"
echo "* Version: DEV 20200411"
echo "* Version: DEV 20200414"
echo ""
}

Expand Down

0 comments on commit 598b54a

Please sign in to comment.