diff --git a/README-id.md b/README-id.md index 6f4c783844123a7dc1e98af5830eab52cec33a5d..a85963b49a09be8c5bacc4105b9b2c967a5a93d8 100644 --- a/README-id.md +++ b/README-id.md @@ -57,7 +57,7 @@ dan jangan sentuh / ubah file apapun di dalam folder <code>/data/adb/modules/(Id * force_doze.conf * paksa ke mode doze ketika layarnya mati * 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 * kalo situ pake modol tweak laennya, teros jadi conflict, cobain set ke 1, default 0 * write_info.conf diff --git a/README.md b/README.md index 3692c545100c292d801bc9bcf5f53be189542bbb..c9819bb3c45b01e4f4c25aeb3cfcd2656bc39fa5 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ and please dont touch / edit any files inside folder <code>/data/adb/modules/(Mo * force_doze.conf * forcing to doze idle state when display/screen off * 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 * if u use another tweak modules, then its conflict, try set this to 1, default 0 * write_info.conf diff --git a/system/etc/ZyC-Core/main.sh b/system/etc/ZyC-Core/main.sh index 339c7230d58d5aff41a92c1516b2c05434568a8b..d8ef7553f6b7f6008d7890528dcc845f950a0c3d 100644 --- a/system/etc/ZyC-Core/main.sh +++ b/system/etc/ZyC-Core/main.sh @@ -136,9 +136,15 @@ CpuInpuBoostUpdate "on" UpdateGov write "$PMConfig/gov_on.conf" if [[ "$CpuTweakMode" == "1" ]];then + # https://github.com/tytydraco/KTweak/tree/latency CpuPerformance VmPerformance fi + if [[ "$CpuTweakMode" == "2" ]];then + # https://github.com/tytydraco/KTweak/tree/throughput + CpuPerformanceB + VmPerformanceB + fi GoTurbo="0" GoNormal="0" elif [[ "$GoNormal" -ge "$MaxCheckGpuUsage" ]] && [[ "$GheymingMode" == "y" ]];then @@ -146,7 +152,8 @@ SetOff CpuInpuBoostUpdate "off" UpdateGov write "$PMConfig/gov_off.conf" - if [[ "$CpuTweakMode" == "1" ]];then + if [[ "$CpuTweakMode" == "1" ]] || [[ "$CpuTweakMode" == "2" ]];then + # https://github.com/tytydraco/KTweak/tree/balance CpuBalance VmBalance fi diff --git a/system/etc/ZyC-Core/misc/funclist.sh b/system/etc/ZyC-Core/misc/funclist.sh index fe0b3a99e969d283da0ff5dbd2ff9b237a417b9c..d5ab14534bb5dc0a02e4e033297b82a0c8f45c5a 100644 --- a/system/etc/ZyC-Core/misc/funclist.sh +++ b/system/etc/ZyC-Core/misc/funclist.sh @@ -952,6 +952,61 @@ VmPerformance(){ 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(){ local Lt="-1" local Bg="-1"