Skip to content
Snippets Groups Projects
Verified Commit f4698a4a authored by zycromerz's avatar zycromerz
Browse files

add new tweak for cpu

- set to 2 for using tweak from 'latency' ktweak

Signed-off-by: default avatarZyCromerZ <neetroid97@gmail.com>
parent 04680e67
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,7 @@ dan jangan sentuh / ubah file apapun di dalam folder <code>/data/adb/modules/(Id ...@@ -57,7 +57,7 @@ dan jangan sentuh / ubah file apapun di dalam folder <code>/data/adb/modules/(Id
* force_doze.conf * force_doze.conf
* paksa ke mode doze ketika layarnya mati * paksa ke mode doze ketika layarnya mati
* use_cpu_tweak.conf * use_cpu_tweak.conf
* kalo anda mau pake beberapa tweak cpu, tinggal set ke 1 * kalo anda mau pake beberapa tweak cpu, tinggal set ke 1 atau 2
* silent_overwrite.conf * silent_overwrite.conf
* kalo situ pake modol tweak laennya, teros jadi conflict, cobain set ke 1, default 0 * kalo situ pake modol tweak laennya, teros jadi conflict, cobain set ke 1, default 0
* write_info.conf * write_info.conf
......
...@@ -57,7 +57,7 @@ and please dont touch / edit any files inside folder <code>/data/adb/modules/(Mo ...@@ -57,7 +57,7 @@ and please dont touch / edit any files inside folder <code>/data/adb/modules/(Mo
* force_doze.conf * force_doze.conf
* forcing to doze idle state when display/screen off * forcing to doze idle state when display/screen off
* use_cpu_tweak.conf * use_cpu_tweak.conf
* if u want to apply some cpu tweak from this modules, just set it to 1 * if u want to apply some cpu tweak from this modules, just set it to 1 or 2
* silent_overwrite.conf * silent_overwrite.conf
* if u use another tweak modules, then its conflict, try set this to 1, default 0 * if u use another tweak modules, then its conflict, try set this to 1, default 0
* write_info.conf * write_info.conf
......
...@@ -136,9 +136,15 @@ ...@@ -136,9 +136,15 @@
CpuInpuBoostUpdate "on" CpuInpuBoostUpdate "on"
UpdateGov write "$PMConfig/gov_on.conf" UpdateGov write "$PMConfig/gov_on.conf"
if [[ "$CpuTweakMode" == "1" ]];then if [[ "$CpuTweakMode" == "1" ]];then
# https://github.com/tytydraco/KTweak/tree/latency
CpuPerformance CpuPerformance
VmPerformance VmPerformance
fi fi
if [[ "$CpuTweakMode" == "2" ]];then
# https://github.com/tytydraco/KTweak/tree/throughput
CpuPerformanceB
VmPerformanceB
fi
GoTurbo="0" GoTurbo="0"
GoNormal="0" GoNormal="0"
elif [[ "$GoNormal" -ge "$MaxCheckGpuUsage" ]] && [[ "$GheymingMode" == "y" ]];then elif [[ "$GoNormal" -ge "$MaxCheckGpuUsage" ]] && [[ "$GheymingMode" == "y" ]];then
...@@ -146,7 +152,8 @@ ...@@ -146,7 +152,8 @@
SetOff SetOff
CpuInpuBoostUpdate "off" CpuInpuBoostUpdate "off"
UpdateGov write "$PMConfig/gov_off.conf" UpdateGov write "$PMConfig/gov_off.conf"
if [[ "$CpuTweakMode" == "1" ]];then if [[ "$CpuTweakMode" == "1" ]] || [[ "$CpuTweakMode" == "2" ]];then
# https://github.com/tytydraco/KTweak/tree/balance
CpuBalance CpuBalance
VmBalance VmBalance
fi fi
......
...@@ -952,6 +952,61 @@ VmPerformance(){ ...@@ -952,6 +952,61 @@ VmPerformance(){
swappiness:100 vfs_cache_pressure:80 swappiness:100 vfs_cache_pressure:80
} }
CpuPerformanceB(){
local UINT_MAX="4294967295"
local SCHED_PERIOD="$((1 * 1000 * 1000))"
local SCHED_TASKS="10"
local IFS
local governor
local queue
WriteSysKernel perf_cpu_time_max_percent:3 sched_autogroup_enabled:1 sched_child_runs_first:1 sched_tunable_scaling:0 "sched_latency_ns:$SCHED_PERIOD" \
"sched_min_granularity_ns:$((SCHED_PERIOD / SCHED_TASKS))" "sched_wakeup_granularity_ns:$((SCHED_PERIOD / 2))" sched_migration_cost_ns:5000000 \
sched_min_task_util_for_colocation:0 sched_nr_migrate:4 sched_schedstats:0 printk_devkmsg:off
WriteTo 1 /dev/stune/top-app/schedtune.prefer_idle
WriteTo 1 /dev/stune/top-app/schedtune.boost
find /sys/devices/system/cpu/ -name schedutil -type d | while IFS= read -r governor
do
WriteTo "0" "$governor/up_rate_limit_us"
WriteTo "0" "$governor/down_rate_limit_us"
WriteTo "0" "$governor/rate_limit_us"
WriteTo 85 "$governor/hispeed_load"
WriteTo "$UINT_MAX" "$governor/hispeed_freq"
done
find /sys/devices/system/cpu/ -name blu_schedutil -type d | while IFS= read -r governor
do
WriteTo "0" "$governor/up_rate_limit_us"
WriteTo "0" "$governor/down_rate_limit_us"
WriteTo "0" "$governor/rate_limit_us"
WriteTo 85 "$governor/hispeed_load"
WriteTo "$UINT_MAX" "$governor/hispeed_freq"
done
find /sys/devices/system/cpu/ -name interactive -type d | while IFS= read -r governor
do
WriteTo "0" "$governor/timer_rate"
WriteTo "0" "$governor/min_sample_time"
WriteTo 85 "$governor/go_hispeed_load"
WriteTo "$UINT_MAX" "$governor/hispeed_freq"
done
for queue in /sys/block/*/queue
do
WriteTo 0 "$queue/add_random"
WriteTo 0 "$queue/iostats"
WriteTo 32 "$queue/read_ahead_kb"
WriteTo 32 "$queue/nr_requests"
done
}
VmPerformanceB(){
WriteSysVm dirty_background_ratio:15 dirty_ratio:30 dirty_expire_centisecs:3000 dirty_writeback_centisecs:3000 page-cluster:0 stat_interval:10 \
swappiness:100 vfs_cache_pressure:80
}
SetFreqCpu(){ SetFreqCpu(){
local Lt="-1" local Lt="-1"
local Bg="-1" local Bg="-1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment