From 12bb1925c72fcc4f89fe49b643f22e11876f0acf Mon Sep 17 00:00:00 2001 From: Matt Yang Date: Sun, 5 Jun 2022 20:01:29 +0800 Subject: [PATCH] DEV 22.06.05 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 更多兼容性CPU频率写入器 - 新增 兼容性生成CPU频率表 - 修复 微信小程序启动缓慢 - 修复 前台程序破音 - 修复 部分崩溃问题 - 修复 部分高通平台息屏功耗过高,感谢@NepPoseidon - ...合计64个commit Signed-off-by: Matt Yang --- changelog.md | 9 ++ config/README.md | 9 +- config/template.json | 161 ++++++++++++++++----------------- magisk/module.prop | 4 +- magisk/script/libcommon.sh | 13 +++ magisk/script/powercfg.json | 2 +- magisk/script/powercfg_once.sh | 36 ++++---- magisk/script/setup.sh | 2 +- version.json | 4 +- 9 files changed, 131 insertions(+), 109 deletions(-) diff --git a/changelog.md b/changelog.md index f737bbb..67a25cf 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,14 @@ # 更新日志 +## DEV 22.06.05 + +- 新增 更多兼容性CPU频率写入器 +- 新增 兼容性生成CPU频率表 +- 修复 微信小程序启动缓慢 +- 修复 前台程序破音 +- 修复 部分崩溃问题 +- 修复 部分高通平台息屏功耗过高,感谢@NepPoseidon + ## DEV 22.05.20 - 新增 开放配置文件自定义 diff --git a/config/README.md b/config/README.md index 0ebeda2..30aa836 100644 --- a/config/README.md +++ b/config/README.md @@ -67,7 +67,7 @@ touch --> idle: timeout / not rendering | ------- | ----- | -------------------------------------------------- | | idle | float | (单位:秒)默认 | | touch | float | (单位:秒)触摸屏幕/按下按键 | -| trigger | float | (单位:秒)点击操作离开屏幕/滑动操作起始 | +| trigger | float | (单位:秒)点击操作离开屏幕/松开按键/滑动操作起始 | | gesture | float | (单位:秒)全面屏手势 | | switch | float | (单位:秒)应用切换动画/点亮屏幕 | | junk | float | (单位:秒)touch/gesture 中 sfanalysis 检测到掉帧 | @@ -124,6 +124,8 @@ touch --> idle: timeout / not rendering 仅需一组实测数据即可完成标定。经验模型结合实测数据,保持模型精度并显著减少平台适配工作量。类型为对象列表,与 CPU 集群顺序一致。 +注:**典型频点并非调频最大值**,大于典型频点的功耗使用模型外插计算。 + | 字段 | 类型 | 描述 | | ------------ | ----- | --------------------------------------------- | | efficiency | int | 单核相对同频性能(以Cortex-A53@1.0Ghz为 100) | @@ -275,7 +277,7 @@ touch --> idle: timeout / not rendering 2. 计算每个集群的性能负载和性能需求 - 如果 CPU 集群最大负载增加量大于`predictThd`,则性能需求计算使用预测的负载值 - 根据性能负载计算性能需求,`demand = load + (1 - load) * (margin + burst)` - - `burst`与`margin`不同,即使当前负载较低也能计算到较大的性能需求 + - 与`margin`不同,`burst`非零时即使当前负载较低也能计算到较大的性能需求 3. 计算性能需求对应的工作频点 - CPU 整体如果存在多个集群,它们共享整个`latencyTime`,表示从性能最低的集群的最低频到性能最高的集群的最高频率的最小延迟 - 由于离散采样周期的存在,实测 CPU 整体升频最小延迟一般会大于设定的`latencyTime` @@ -286,6 +288,7 @@ touch --> idle: timeout / not rendering - 如果当前能耗大于`slowLimitPower`,能耗缓冲池余量减少 - 如果当前能耗小于`slowLimitPower`,能耗缓冲池余量增加,并按照`fastLimitRecoverScale`缩放因子恢复,总量不超过`fastLimitCapacity` - 限制 CPU 功耗根据能耗模型选择最优频率限制,在限定功耗下提供最佳整体性能 + - `burst`非零时忽略`fastLimitPower`和`slowLimitPower`限制 5. 引导任务调度器放置任务 - 启用`guideCap`后,根据能耗模型调节集群性能容量,引导 EAS 任务调度器把任务放置到能效最佳的集群 - 启用`limitEfficiency`后,低性能集群最大频点能效值不高于高性能集群当前频点的能效值 @@ -303,7 +306,7 @@ touch --> idle: timeout / not rendering | fastLimitRecoverScale | float | (0.1~10.0)CPU 短期功耗限制容量恢复缩放因子 | | predictThd | float | (0.1~1.0)CPU 集群最大负载增加量大于该阈值,则集群调频使用预测的负载值,并忽略`latencyTime` | | margin | float | (0.0~1.0)调频提供的性能余量 | -| burst | float | (0.0~1.0)调频提供的额外性能余量,非零时忽略`latencyTime` | +| burst | float | (0.0~1.0)调频提供的额外性能余量,非零时忽略`latencyTime`和功耗限制 | | guideCap | bool | 启用引导 EAS 任务调度负载转移 | | limitEfficiency | bool | 启用 CPU 整体能效限制 | diff --git a/config/template.json b/config/template.json index 962ea3e..04edfcf 100644 --- a/config/template.json +++ b/config/template.json @@ -12,9 +12,9 @@ "touch": 4.0, "trigger": 0.02, "gesture": 0.1, - "switch": 0.3, - "junk": 0.04, - "swjunk": 0.04 + "switch": 0.4, + "junk": 0.02, + "swjunk": 0.02 } }, "atrace": { @@ -25,7 +25,7 @@ }, "input": { "enable": true, - "swipeThd": 0.005, + "swipeThd": 0.01, "gestureThdX": 0.03, "gestureThdY": 0.03, "gestureDelayTime": 2.0, @@ -62,25 +62,25 @@ "gtmain": [7] }, "affinity": { - "norm": { "bg": "", "fg": "norm", "idle": "all", "touch": "all", "boost": "all" }, - "bg": { "bg": "eff", "fg": "eff", "idle": "eff", "touch": "eff", "boost": "" }, - "coop": { "bg": "eff", "fg": "eff", "idle": "norm", "touch": "norm", "boost": "" }, - "trig": { "bg": "", "fg": "eff", "idle": "eff", "touch": "bal", "boost": "bal" }, - "crit": { "bg": "", "fg": "norm", "idle": "", "touch": "bal", "boost": "bal" }, - "mix": { "bg": "", "fg": "norm", "idle": "all", "touch": "bal", "boost": "bal" }, - "main": { "bg": "", "fg": "norm", "idle": "", "touch": "bal", "boost": "norm" }, - "binder": { "bg": "", "fg": "norm", "idle": "norm", "touch": "bal", "boost": "perf" }, - "gtcoop": { "bg": "", "fg": "norm", "idle": "perf", "touch": "gtcoop", "boost": "gtcoop" }, - "gtmain": { "bg": "", "fg": "norm", "idle": "perf", "touch": "gtmain", "boost": "gtmain" }, - "auto": { "bg": "", "fg": "", "idle": "", "touch": "", "boost": "" } + "auto": { "bg": "", "fg": "", "idle": "", "touch": "", "boost": "" }, + "norm": { "bg": "norm", "fg": "eff", "idle": "all", "touch": "norm", "boost": "norm" }, + "bg": { "bg": "norm", "fg": "eff", "idle": "eff", "touch": "eff", "boost": "eff" }, + "coop": { "bg": "norm", "fg": "norm", "idle": "norm", "touch": "norm", "boost": "all" }, + "ui": { "bg": "norm", "fg": "norm", "idle": "norm", "touch": "bal", "boost": "bal" }, + "binder": { "bg": "norm", "fg": "norm", "idle": "norm", "touch": "norm", "boost": "perf" }, + "crit": { "bg": "norm", "fg": "norm", "idle": "bal", "touch": "bal", "boost": "bal" }, + "gtcoop": { "bg": "norm", "fg": "norm", "idle": "perf", "touch": "gtcoop", "boost": "all" }, + "gtmain": { "bg": "norm", "fg": "norm", "idle": "perf", "touch": "gtmain", "boost": "all" } }, "prio": { - "rtsys": { "bg": 97, "fg": 97, "idle": 97, "touch": 97, "boost": 96 }, + "auto": { "bg": 0, "fg": 0, "idle": 0, "touch": 0, "boost": 0 }, + "norm": { "bg": -3, "fg": -1, "idle": -1, "touch": -1, "boost": -1 }, + "bg": { "bg": -3, "fg": 139, "idle": 139, "touch": 139, "boost": -3 }, + "coop": { "bg": -3, "fg": 121, "idle": 121, "touch": 121, "boost": -3 }, + "ui": { "bg": -3, "fg": 120, "idle": 110, "touch": 98, "boost": 116 }, + "main": { "bg": -3, "fg": 120, "idle": 110, "touch": 104, "boost": 98 }, "rtusr": { "bg": 98, "fg": 98, "idle": 98, "touch": 98, "boost": 97 }, - "ux": { "bg": -3, "fg": 122, "idle": 104, "touch": 104, "boost": 100 }, - "bg": { "bg": -3, "fg": -3, "idle": -3, "touch": -3, "boost": -3 }, - "norm": { "bg": -3, "fg": -1, "idle": -1, "touch": -1, "boost": -3 }, - "auto": { "bg": 0, "fg": 0, "idle": 0, "touch": 0, "boost": 0 } + "rtsys": { "bg": 97, "fg": 97, "idle": 97, "touch": 97, "boost": 96 } }, "rules": [ { @@ -99,12 +99,11 @@ "regex": "/system/bin/surfaceflinger", "pinned": true, "rules": [ - { "k": "/MAIN_THREAD/", "ac": "trig", "pc": "rtsys" }, - { "k": "^RenderEngine", "ac": "crit", "pc": "rtsys" }, + { "k": "/MAIN_THREAD/", "ac": "ui", "pc": "auto" }, + { "k": "^(app|RenderEngine)", "ac": "ui", "pc": "auto" }, { "k": "^Binder:", "ac": "binder", "pc": "auto" }, - { "k": "^app", "ac": "trig", "pc": "rtsys" }, - { "k": "^[Ss]f|Timer|Idle", "ac": "bg", "pc": "rtsys" }, - { "k": ".", "ac": "bg", "pc": "rtsys" } + { "k": "^[Ss]f|Timer|Idle", "ac": "bg", "pc": "auto" }, + { "k": ".", "ac": "bg", "pc": "auto" } ] }, { @@ -114,17 +113,15 @@ "rules": [ { "k": "^(android.anim|android.display|android.bg)", "ac": "crit", "pc": "rtusr" }, { "k": "^Binder:", "ac": "binder", "pc": "auto" }, - { "k": "^[Ii]nput", "ac": "trig", "pc": "ux" }, - { "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", "ac": "binder", "pc": "bg" }, { "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", "ac": "bg", "pc": "auto" }, - { "k": ".", "ac": "coop", "pc": "auto" } + { "k": ".", "ac": "auto", "pc": "auto" } ] }, { - "name": "Phone", - "regex": "com.android.phone", + "name": "SystemUI", + "regex": "com.android.systemui", "pinned": true, - "rules": [{ "k": ".", "ac": "coop", "pc": "auto" }] + "rules": [{ "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", "ac": "bg", "pc": "auto" }] }, { "name": "MediaProvider", @@ -134,7 +131,7 @@ }, { "name": "Memory reclaim", - "regex": "^(kswapd0|kcompactd0)", + "regex": "swapd|compactd", "pinned": true, "rules": [{ "k": ".", "ac": "auto", "pc": "bg" }] }, @@ -148,10 +145,10 @@ ] }, { - "name": "SystemUI", - "regex": "com.android.systemui", + "name": "Phone", + "regex": "com.android.phone", "pinned": false, - "rules": [{ "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", "ac": "bg", "pc": "norm" }] + "rules": [{ "k": ".", "ac": "auto", "pc": "auto" }] }, { "name": "Other system processes", @@ -164,8 +161,8 @@ "regex": "[.].+:", "pinned": false, "rules": [ - { "k": "^Binder:", "ac": "norm", "pc": "norm" }, - { "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", "ac": "bg", "pc": "norm" } + { "k": "^Binder:", "ac": "auto", "pc": "auto" }, + { "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", "ac": "bg", "pc": "auto" } ] }, { @@ -173,28 +170,17 @@ "regex": ".", "pinned": false, "rules": [ - { "k": "/MAIN_THREAD/", "ac": "main", "pc": "ux" }, - { "k": "[.]ui$", "ac": "main", "pc": "ux" }, - { "k": "^(UnityMain|RenderThread |GameThread)", "ac": "gtmain", "pc": "ux" }, - { "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", "ac": "gtcoop", "pc": "ux" }, - { "k": "^(NativeThread|Timer-)", "ac": "bg", "pc": "norm" }, - { "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", "ac": "coop", "pc": "norm" }, - { "k": "^(Viz|Chrome_|Compositor)", "ac": "coop", "pc": "ux" }, - { "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", "ac": "coop", "pc": "bg" }, - { "k": "^Thread-", "ac": "mix", "pc": "norm" }, - { "k": "[Aa]sync", "ac": "norm", "pc": "bg" }, - { "k": "[Vv]sync|mali-", "ac": "coop", "pc": "ux" }, - { "k": "^(pool-|glide-|launcher-)", "ac": "coop", "pc": "bg" }, - { "k": "^(OkHttp|Ysa|Xqa|Rx|Fresco|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", "ac": "bg", "pc": "norm" }, - { "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", "ac": "bg", "pc": "norm" }, - { "k": "^([Dd]ownload|ThreadPoolForeg|launcher-idle-|fe_single_pool)", "ac": "bg", "pc": "norm" }, - { "k": "[Ss]chedule|[.][.][.]$|[.]so$", "ac": "bg", "pc": "norm" }, - { "k": "[Ww]ork|[Pp]ool", "ac": "coop", "pc": "norm" }, + { "k": "/MAIN_THREAD/", "ac": "ui", "pc": "main" }, + { "k": "^(UnityMain|RenderThread |GameThread)", "ac": "gtmain", "pc": "auto" }, + { "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", "ac": "gtcoop", "pc": "auto" }, + { "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", "ac": "ui", "pc": "ui" }, + { "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", "ac": "coop", "pc": "coop" }, + { "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", "ac": "norm", "pc": "ui" }, + { "k": "^(OkHttp|Ysa|Xqa|Rx|Fresco|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", "ac": "bg", "pc": "auto" }, + { "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", "ac": "bg", "pc": "auto" }, { "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", "ac": "bg", "pc": "rtusr" }, - { "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)", "ac": "main", "pc": "ux" }, - { "k": "[.]raster$", "ac": "crit", "pc": "ux" }, - { "k": "[Aa]nim", "ac": "crit", "pc": "ux" }, - { "k": "^Binder:", "ac": "trig", "pc": "auto" }, + { "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", "ac": "coop", "pc": "coop" }, + { "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau", "ac": "coop", "pc": "coop" }, { "k": ".", "ac": "norm", "pc": "norm" } ] } @@ -239,43 +225,48 @@ "idle": { "cpu.baseSampleTime": 0.04, "cpu.baseSlackTime": 0.08, + "cpu.predictThd": 0.1, "cpu.limitEfficiency": true, "sched.scene": "idle" }, "touch": { + "cpu.baseSampleTime": 0.04, "sched.scene": "touch" }, "trigger": { - "cpu.margin": 0.7, + "cpu.margin": 0.6, "sched.scene": "touch" }, "gesture": { - "cpu.margin": 0.7, + "cpu.margin": 0.6, "sched.scene": "touch" }, "junk": { - "cpu.burst": 0.55, + "cpu.baseSampleTime": 0.04, + "cpu.burst": 0.5, "sched.scene": "touch" }, "switch": { + "cpu.latencyTime": 0.0, "cpu.slowLimitPower": 5.0, - "cpu.guideCap": false, - "cpu.margin": 0.3, + "cpu.fastLimitCapacity": 0.0, + "cpu.margin": 0.4, "sched.scene": "boost" }, "swjunk": { + "cpu.latencyTime": 0.0, "cpu.slowLimitPower": 5.0, - "cpu.guideCap": false, - "cpu.margin": 0.3, - "cpu.burst": 0.55, + "cpu.fastLimitCapacity": 0.0, + "cpu.margin": 0.4, + "cpu.burst": 0.5, "sched.scene": "boost" } }, "powersave": { "*": { - "cpu.latencyTime": 0.5, - "cpu.slowLimitPower": 1.5, - "cpu.fastLimitPower": 3.0, + "cpu.latencyTime": 0.4, + "cpu.slowLimitPower": 1.0, + "cpu.fastLimitPower": 2.5, "cpu.fastLimitCapacity": 0.5, "cpu.margin": 0.1 }, @@ -287,31 +278,35 @@ "sched.scene": "idle" }, "touch": { + "cpu.baseSampleTime": 0.04, "sched.scene": "touch" }, "trigger": { - "cpu.margin": 0.4, + "cpu.margin": 0.6, "sched.scene": "touch" }, "gesture": { - "cpu.margin": 0.4, + "cpu.margin": 0.6, "sched.scene": "touch" }, "junk": { - "cpu.burst": 0.45, + "cpu.baseSampleTime": 0.04, + "cpu.burst": 0.3, "sched.scene": "touch" }, "switch": { - "cpu.slowLimitPower": 3.0, - "cpu.guideCap": false, - "cpu.margin": 0.2, + "cpu.latencyTime": 0.0, + "cpu.slowLimitPower": 2.5, + "cpu.fastLimitCapacity": 0.0, + "cpu.margin": 0.3, "sched.scene": "boost" }, "swjunk": { - "cpu.slowLimitPower": 3.0, - "cpu.guideCap": false, - "cpu.margin": 0.2, - "cpu.burst": 0.45, + "cpu.latencyTime": 0.0, + "cpu.slowLimitPower": 2.5, + "cpu.fastLimitCapacity": 0.0, + "cpu.margin": 0.3, + "cpu.burst": 0.3, "sched.scene": "boost" } }, @@ -340,7 +335,7 @@ "sched.scene": "touch" }, "junk": { - "cpu.burst": 0.55, + "cpu.burst": 0.5, "sched.scene": "touch" }, "switch": { @@ -348,7 +343,7 @@ "sched.scene": "boost" }, "swjunk": { - "cpu.burst": 0.55, + "cpu.burst": 0.5, "sched.scene": "boost" } }, @@ -377,7 +372,7 @@ "sched.scene": "touch" }, "junk": { - "cpu.burst": 0.55, + "cpu.burst": 0.5, "sched.scene": "touch" }, "switch": { @@ -385,7 +380,7 @@ "sched.scene": "boost" }, "swjunk": { - "cpu.burst": 0.55, + "cpu.burst": 0.5, "sched.scene": "boost" } } diff --git a/magisk/module.prop b/magisk/module.prop index 8095f98..932734f 100644 --- a/magisk/module.prop +++ b/magisk/module.prop @@ -1,7 +1,7 @@ id=uperf name=Uperf -version=v3(22.05.20) -versionCode=220520 +version=v3(22.06.05) +versionCode=220605 author=Matt Yang description=Userspace performance controller for android. Repo: https://github.com/yc9559/uperf/ updateJson=https://github.com/yc9559/uperf/raw/master/version.json diff --git a/magisk/script/libcommon.sh b/magisk/script/libcommon.sh index 49c48bd..86ce735 100644 --- a/magisk/script/libcommon.sh +++ b/magisk/script/libcommon.sh @@ -31,6 +31,19 @@ lock_val() { done } +# $1:value $2:filepaths +mask_val() { + touch /data/local/tmp/mount_mask + for p in $2; do + if [ -f "$p" ]; then + umount "$p" + chmod 0666 "$p" + echo "$1" >"$p" + mount --bind /data/local/tmp/mount_mask "$p" + fi + done +} + # $1:value $2:filepaths mutate() { for p in $2; do diff --git a/magisk/script/powercfg.json b/magisk/script/powercfg.json index 97a7c28..4b6ef0c 100644 --- a/magisk/script/powercfg.json +++ b/magisk/script/powercfg.json @@ -1,7 +1,7 @@ { "name": "Uperf", "author": "Matt Yang", - "version": "22.05.20", + "version": "22.06.05", "versionCode": 3, "features": { "strict": true, diff --git a/magisk/script/powercfg_once.sh b/magisk/script/powercfg_once.sh index 4578af2..b81a43a 100644 --- a/magisk/script/powercfg_once.sh +++ b/magisk/script/powercfg_once.sh @@ -25,20 +25,19 @@ BASEDIR="$(dirname $(readlink -f "$0"))" unify_cgroup() { # clear top-app - for cg in cpuset stune cpuctl; do - for p in $(cat /dev/$cg/top-app/tasks); do - echo $p >/dev/$cg/foreground/tasks - done + for p in $(cat /dev/cpuset/top-app/tasks); do + echo $p >/dev/cpuset/foreground/tasks done # unused rmdir /dev/cpuset/foreground/boost # work with uperf/ContextScheduler - change_task_cgroup "surfaceflinger|system_server" "" "cpuset" - change_task_cgroup "netd|allocator|kswapd0|kcompactd0" "foreground" "cpuset" - change_task_cgroup "android.hardware.media|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 "surfaceflinger|system_server" "foreground" "cpuset" + change_thread_cgroup "surfaceflinger|system_server" "^Binder" "" "cpuset" + change_task_cgroup "netd|allocator" "foreground" "cpuset" + change_task_cgroup "hardware.media.c2|vendor.mediatek.hardware" "background" "cpuset" + change_task_cgroup "aal_sof|kfps|dsp_send_thread|vdec_ipi_recv|mtk_drm_disp_id|disp_feature|hif_thread|main_thread|rx_thread|ged_" "background" "cpuset" change_task_cgroup "pp_event|crtc_" "background" "cpuset" } @@ -46,28 +45,26 @@ unify_sched() { # clear stune & uclamp for d in /dev/stune/*/; do lock_val "0" $d/schedtune.boost + lock_val "0" $d/schedtune.prefer_idle done for d in /dev/cpuctl/*/; do lock_val "0" $d/cpu.uclamp.min + lock_val "0" $d/cpu.uclamp.latency_sensitive done for d in kernel walt; do - lock_val "0" /proc/sys/$d/sched_force_lb_enable - lock_val "255" /proc/sys/$d/sched_busy_hysteresis_enable_cpus - lock_val "2000000" /proc/sys/$d/sched_busy_hyst_ns + mask_val "0" /proc/sys/$d/sched_force_lb_enable done } unify_devfreq() { - for d in /sys/class/devfreq/*; do - local maxfreq="0" - for f in $(cat $d/available_frequencies); do - [ "$f" -gt "$maxfreq" ] && maxfreq="$f" + for df in /sys/class/devfreq; do + for d in $df/*cpubw $df/*llccbw $df/*cpu-cpu-llcc-bw $df/*cpu-llcc-ddr-bw; do + lock_val "9999000000" "$d/max_freq" 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" + lock_val "9999000000" "/sys/devices/system/cpu/bus_dcvs/$d/*/max_freq" done } @@ -76,6 +73,10 @@ unify_lpm() { lock_val "0" /sys/module/lpm_levels/parameters/lpm_ipi_prediction lock_val "0" /sys/module/lpm_levels/parameters/lpm_prediction lock_val "2" /sys/module/lpm_levels/parameters/bias_hyst + for d in kernel walt; do + mask_val "255" /proc/sys/$d/sched_busy_hysteresis_enable_cpus + mask_val "2000000" /proc/sys/$d/sched_busy_hyst_ns + done } disable_hotplug() { @@ -178,6 +179,7 @@ disable_userspace_boost() { # work with uperf/ContextScheduler lock_val "0" "/sys/module/mtk_fpsgo/parameters/boost_affinity*" lock_val "0" "/sys/module/fbt_cpu/parameters/boost_affinity*" + lock_val "9999000" "/sys/kernel/fpsgo/fbt/limit_*" 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 diff --git a/magisk/script/setup.sh b/magisk/script/setup.sh index 139e6ea..1e56c43 100644 --- a/magisk/script/setup.sh +++ b/magisk/script/setup.sh @@ -74,7 +74,7 @@ install_uperf() { echo "" echo "* Uperf https://github.com/yc9559/uperf/" echo "* Author: Matt Yang" -echo "* Version: v3(22.05.20)" +echo "* Version: v3(22.06.05)" echo "" echo "- Installing uperf" diff --git a/version.json b/version.json index c5e3cdf..138e2ac 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { - "versionCode": 220520, + "versionCode": 220605, "version": "v3", - "zipUrl": "https://github.com/yc9559/uperf/releases/download/dev-22.05.20/uperf-dev-22.05.20.zip", + "zipUrl": "https://github.com/yc9559/uperf/releases/download/dev-22.06.05/uperf-dev-22.06.05.zip", "changelog": "https://github.com/yc9559/uperf/raw/master/changelog.md" }