[HTC 10 Guides, News, & Discussion] Haldi4803:
#!/system/bin/sh
#Author: Asiier
#Settings By: Asiier
#Device: One Plus 3
#Codename: Project Zhana (BT)
#Build Status: Stable
#Version: 4.2
#Last Updated: 22/01/2017
#Notes: Please give credit when using this in your work!
#TWEAKS_BEGIN
echo ""
echo --------------------------------------------------------
echo Applying 'Project Zhana (Battery variant)' v4.3
echo Advanced Kernel Settings
echo --------------------------------------------------------
sleep 0.5
echo Author: Asiier
echo Settings By: Asiier
echo "Device: One Plus 3 & SD820 Devices"
echo Codename: 'Project Zhana (BT)'
echo Build Status: Stable
echo Last Updated: 19/09/2017
echo For more information go to the XDA theard
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sleep 0.3
echo Checking Android version...
if grep -q 'ro.build.version.sdk=25' /system/build.prop; then
echo Android Nougat 7.1.X detected!
sleep 0.3
echo N detected... Applying proper settings
fi
if grep -q 'ro.build.version.sdk=24' /system/build.prop; then
echo Android Nougat 7.0.X detected!
sleep 0.3
echo N detected... Applying proper settings
fi
if grep -q 'ro.build.version.sdk=23' /system/build.prop; then
echo Android Marshmallow 6.0.1 detected!
sleep 0.3
echo MM detected... Applying proper settings
fi
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sleep 0.3
#Apply settings to LITTLE cluster
echo Applying settings to LITTLE Cluster...
sleep 0.5
#Temporarily change permissions to governor files for the LITTLE cluster to enable Interactive governor
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#Grab Maximum Achievable Frequency for the LITTLE Cluster
maxfreq=$(cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")
if test "$maxfreq" -eq 1593600; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 1593MHz
echo No LITTLE Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1593600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1593MHz
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
fi
if test "$maxfreq" -eq 1728000; then
#Temporarily change permissions to governor files for the Little cluster to set the maximum frequency to 1728MHz
echo LITTLE Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1728000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1728MHz
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
maxfreq=$(cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")
fi
if test "$maxfreq" -lt 1593600; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 1593MHz
echo LITTLE Cluster Underclocking detected!!
sleep 1
echo We recommend not to UnderClock the CPU as the tweaks already will take care of that If needed
echo The tweaks will continue getting applied but we recommend setting the CPU to Max frequency!
sleep 4
#chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#echo 1593600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1593MHz
#chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
elif test $maxfreq -gt 1728000; then
#Temporarily change permissions to governor files for the Little cluster to set the maximum frequency to 1728MHz
echo LITTLE Cluster Overclocking detected.
sleep 1
echo This OverClock is higher than normal and only possible on Xceed Kernel
echo The tweak will continue getting applyed
echo " Althought it might no reach the maximum frequency you have setted as it haven't been made to work with frecuencies higher than 1728 Mhz "
#chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#echo 1728000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1728MHz
#chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
fi
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/*
echo 220000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack
echo 307200 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
echo 0 729600:76000 960000:99000 1228800:150000 1478400:170000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
echo 155 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
echo 22000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boost
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
fi
sleep 0.5
#Apply settings to Big cluster
echo Applying settings to BIG Cluster
sleep 0.2
#Temporarily change permissions to governor files for the LITTLE cluster to enable Interactive governor
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo interactive > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
#Grab Maximum Achievable Frequency for the Big Cluster
maxfreq=$(cat "/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq")
if test $maxfreq -eq 2150400; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 2150MHz
echo No BIG Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 2150400 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 2 Maximum Frequency = 2150MHz
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
#Set overclock max frequency compatible target_loads
elif test $maxfreq -eq 2265600; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 2265MHz
echo BIG Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 2265600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 2 Maximum Frequency = 2265MHz
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
fi
if test $maxfreq -lt 2150400; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 1593MHz
echo BIG Cluster Underclocking detected!!
sleep 1
echo We recommend not to UnderClock the CPU as the tweaks already will take care of that If needed
echo The tweaks will continue getting applied but we recommend setting the CPU to Max frequency!
sleep 4
#chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
#echo 1593600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1593MHz
#chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
elif test $maxfreq -gt 2265600; then
#Temporarily change permissions to governor files for the Little cluster to set the maximum frequency to 1728MHz
echo BIG Cluster Overclocking detected.
sleep 1
echo This OverClock is higher than normal and only possible on Xceed Kernel
echo The tweak will continue getting applyed
echo " Althought it might no reach the maximum frequency you have setted as it haven't been made to work with frecuencies higher than 2265600 Mhz "
sleep 4
#chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
#echo 1728000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1728MHz
#chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:99 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
fi
sleep 0.5
#Tweak Interactive Governor
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/*
echo 140000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_slack
echo 1401600 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq
echo 65000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate
echo 32000 940800:85000 1248000:96000 1401600:88000 1632000:80000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay
echo 99 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load
echo 11000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boost
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
fi
echo "=========================================="
echo Checking whether you are using a Sultanxda based ROM or not
echo "=========================================="
#Checking whether you are using a Sultanxda based ROM or not
echo Checking ROM...
sleep 0.2
echo Applying appropriate values.
if [ -e "/sys/kernel/cpu_input_boost/enabled" ]; then
echo Enabling Input Boost for the LITTLE cluster @556 MHz and for the BIG Cluster @0Mhz and Custom thermal driver of Sultanxda
chmod 644 /sys/kernel/cpu_input_boost/*
echo 1 > /sys/kernel/cpu_input_boost/enabled
echo 66 > /sys/kernel/cpu_input_boost/ib_duration_ms
echo 556800 0 > /sys/kernel/cpu_input_boost/ib_freqs
chmod 444 /sys/kernel/cpu_input_boost/*
chmod 644 /sys/kernel/msm_thermal/enabled
echo 0 > /sys/kernel/msm_thermal/enabled
chmod 444 /sys/kernel/msm_thermal/enabled
else
#Checking whether you are using a Lineage based ROM or not
echo Checking ROM...
sleep 0.2
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
#Enable Input Boost for LITTLE cluster @556MHz and for BIG cluster @729MHz for 66ms
echo Lineage Based ROM detected
echo Applying appropriate values.
echo Enabling Input Boost at 556 MHz for the LITTLE cluster and at 0 MHz for the BIG Cluster
if [ -e "/sys/module/cpu_boost/parameters/input_boost_freq" ]; then
chmod 644 /sys/module/cpu_boost/parameters/input_boost_freq
echo 0:556800 1:0 2:0 3:0 > /sys/module/cpu_boost/parameters/input_boost_freq
chmod 644 /sys/module/cpu_boost/parameters/input_boost_ms
echo 55 > /sys/module/cpu_boost/parameters/input_boost_ms
else
echo "*Input Boost is not avalible for your Kernel*"
fi
if [ -e "/sys/module/cpu_boost/parameters/boost_ms" ]; then
chmod 644 /sys/module/cpu_boost/parameters/boost_ms
echo 0 > /sys/module/cpu_boost/parameters/boost_ms
else
echo "*Cpu_Boost is not avalible for your Kernel*"
fi
else
#Enable Input Boost for LITTLE cluster @729MHz and for BIG cluster @729Hz for 100ms
echo Non-Lineage ROM detected
echo Applying appropriate values.
echo Enabling Input Boost at 729 MHz for the LITTLE cluster and at 0 MHz for the BIG Cluster
if [ -e "/sys/module/cpu_boost/parameters/input_boost_freq" ]; then
chmod 644 /sys/module/cpu_boost/parameters/input_boost_freq
echo 0:729600 1:0 2:0 3:0 > /sys/module/cpu_boost/parameters/input_boost_freq
chmod 644 /sys/module/cpu_boost/parameters/input_boost_ms
echo 77 > /sys/module/cpu_boost/parameters/input_boost_ms
else
echo "*Input Boost is not avalible for your Kernel*"
fi
if [ -e "/sys/module/cpu_boost/parameters/boost_ms" ]; then
chmod 644 /sys/module/cpu_boost/parameters/boost_ms
echo 0 > /sys/module/cpu_boost/parameters/boost_ms
else
echo "*Cpu_Boost is not avalible for your Kernel*"
fi
fi
fi
sleep 0.3
echo "=========================================="
#Disable TouchBoost
echo Disabling TouchBoost
if [ -e "/sys/module/msm_performance/parameters/touchboost" ]; then
chmod 644 /sys/module/msm_performance/parameters/touchboost
echo 0 > /sys/module/msm_performance/parameters/touchboost
else
echo "*Not supported for your current Kernel*"
fi
#Disable BCL
echo Disabling BCL and Removing Perfd
if [ -e "/sys/devices/soc/soc:qcom,bcl/mode" ]; then
echo -n disable > /sys/devices/soc/soc:qcom,bcl/mode
fi
#Enable Core Control and Disable MSM Thermal Throttling allowing for longer sustained performance
echo Disabling Aggressive CPU Thermal Throttling
if [ -e "/sys/module/msm_thermal/core_control/enabled" ]; then
echo 1 > /sys/module/msm_thermal/core_control/enabled
fi
if [ -e "/sys/module/msm_thermal/parameters/enabled" ]; then
echo N > /sys/module/msm_thermal/parameters/enabled
fi
#Tweak HMP Scheduler to feed the Big cluster more tasks
sleep 0.3
#echo Tweaking HMP Scheduler for correcting BIG Cluster utilization
echo 2 > /proc/sys/kernel/sched_window_stats_policy
echo 85 > /proc/sys/kernel/sched_upmigrate
echo 62 > /proc/sys/kernel/sched_downmigrate
echo 5 > /proc/sys/kernel/sched_spill_nr_run
echo 100 > /proc/sys/kernel/sched_spill_load
echo 30 > /proc/sys/kernel/sched_init_task_load
if [ -e "/proc/sys/kernel/sched_heavy_task" ]; then
echo 65 > /proc/sys/kernel/sched_heavy_task
fi
if [ -e "/proc/sys/kernel/sched_enable_power_aware" ]; then
echo 1 > /proc/sys/kernel/sched_enable_power_aware
fi
echo 10 > /proc/sys/kernel/sched_upmigrate_min_nice
echo 4 > /proc/sys/kernel/sched_ravg_hist_size
if [ -e "/proc/sys/kernel/sched_small_wakee_task_load" ]; then
echo 7 > /proc/sys/kernel/sched_small_wakee_task_load
fi
if [ -e "/proc/sys/kernel/sched_wakeup_load_threshold" ]; then
echo 110 > /proc/sys/kernel/sched_wakeup_load_threshold
fi
if [ -e "/proc/sys/kernel/sched_small_task" ]; then
echo 7 > /proc/sys/kernel/sched_small_task
fi
if [ -e "/proc/sys/kernel/sched_big_waker_task_load" ]; then
echo 35 > /proc/sys/kernel/sched_big_waker_task_load
fi
echo 950000 > /proc/sys/kernel/sched_rt_runtime_us
echo 1000000 > /proc/sys/kernel/sched_rt_period_us
if [ -e "/proc/sys/kernel/sched_migration_fixup" ]; then
echo 1 > /proc/sys/kernel/sched_migration_fixup
fi
if [ -e "/proc/sys/kernel/sched_freq_dec_notify" ]; then
echo 410000 > /proc/sys/kernel/sched_freq_dec_notify
fi
if [ -e "/proc/sys/kernel/sched_freq_inc_notify" ]; then
echo 600000 > /proc/sys/kernel/sched_freq_inc_notify
fi
if [ -e "/proc/sys/kernel/sched_boost" ]; then
echo 0 > /proc/sys/kernel/sched_boost
fi
#Tweaks for other various Settings
sleep 0.5
echo "=========================================="
echo Tweaking other various Settings
echo ·I/O Values
if [ -d /sys/block/dm-0 ] || [ -d /sys/devices/virtual/block/dm-0 ]; then
if [ -e /sys/devices/virtual/block/dm-0/queue/scheduler ]; then
DM_PATH=/sys/devices/virtual/block/dm-0/queue
fi
if [ -e /sys/block/dm-0/queue/scheduler ]; then
DM_PATH=/sys/block/dm-0/queue
fi
string=/sys/devices/virtual/block/dm-0/queue/scheduler;
Zen_Available=false;
if $BB grep 'zen' $string; then
Zen_Available=true;
fi
if [ "$Zen_Available" == "true" ]; then
if [ -e $DM_PATH/scheduler_hard ]; then
echo zen > $DM_PATH/scheduler_hard
fi
echo zen > $DM_PATH/scheduler
sleep 2
echo 300 > $DM_PATH/iosched/sync_expire
echo 2800 > $DM_PATH/iosched/async_expire
echo 14 > $DM_PATH/iosched/fifo_batch
chmod 644 $DM_PATH/iosched/sync_expire
echo 300 > $DM_PATH/iosched/sync_expire
fi
if [ "$Zen_Available" = "false" ]; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo ZEN not avalible, setting 'Noop' instead...
if [ -e $DM_PATH/scheduler_hard ]; then
echo noop > $DM_PATH/scheduler_hard
fi
echo noop > $DM_PATH/scheduler
else
echo ZEN not avalible, setting 'CFQ' instead...
if [ -e $DM_PATH/scheduler_hard ]; then
echo cfq > $DM_PATH/scheduler_hard
fi
echo cfq > $DM_PATH/scheduler
fi
fi
fi
for i in /sys/block/../devices/soc/624000.ufshc/host0/target0:0:0/0:0:0:[0-4]/block/*/queue; do
string4=$($BB readlink -f $i/scheduler | cut -d 'q' -f1 | cut -d 'k' -f2 | cut -d '/' -f2 | tr a-z A-Z)
string5=$($BB cat $i/scheduler | cut -d ']' -f1 | cut -d '[' -f2 | $BB tr a-z A-Z)
if [ "$string5" == "NOOP" ]; then
echo "Leaving $string4 block at default $string5"
echo ""
sleep 0.1
fi
if [ "$string5" != "NOOP" ]; then
echo "Changing $string4 block I/O scheduler"
if [ -e $i/scheduler_hard ]; then
echo zen > $i/scheduler_hard
fi
echo zen > $i/scheduler
echo ""
sleep 2
# Initialize string 6 to avoid reference conflicts
string6=$($BB cat $i/scheduler | cut -d ']' -f1 | cut -d '[' -f2)
if [ "$string6" == "zen" ]; then
echo 300 > $i/iosched/sync_expire
echo 2800 > $i/iosched/async_expire
echo 14 > $i/iosched/fifo_batch
chmod 644 $i/iosched/sync_expire
echo 300 > $i/iosched/sync_expire
fi
fi
done
if [ -e "$DM_PATH/iostats" ]; then
echo 0 > $DM_PATH/iostats
fi
if [ -e "$DM_PATH/rq_affinity" ]; then
echo 1 > $DM_PATH/rq_affinity
fi
if [ -e "/sys/block/dm-0/bdi/read_ahead_kb" ]; then
echo 512 > /sys/devices/virtual/block/dm-0/bdi/read_ahead_kb
fi
if [ -e "/sys/block/sda/bdi/read_ahead_kb" ]; then
echo 512 > /sys/block/sda/bdi/read_ahead_kb
fi
echo ·Memory Values
echo 0 > /proc/sys/vm/swappiness
echo 100 > /proc/sys/vm/vfs_cache_pressure
echo 80 > /proc/sys/vm/dirty_ratio
echo 20 > /proc/sys/vm/dirty_background_ratio
echo 4096 > /proc/sys/vm/min_free_kbytes
echo 100 > /proc/sys/vm/dirty_expire_centisecs
echo 250 > /proc/sys/vm/dirty_writeback_centisecs
echo 0 > /proc/sys/vm/oom_kill_allocating_task
echo 3 > /proc/sys/vm/page-cluster
if [ -e "/sys/module/lowmemorykiller/parameters/enable_adaptive_lmk" ]; then
chmod 666 /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
chown root /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
echo 0 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
fi
if [ -e "/sys/module/lowmemorykiller/parameters/enable_adaptive_lmk" ]; then
echo 0 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
else
echo ' *Adaptive LMK is not present on your Kernel* '
fi
if [ -e "/sys/module/lowmemorykiller/parameters/minfree" ]; then
echo 23939,44091,58788,73485,88182,102879 > /sys/module/lowmemorykiller/parameters/minfree
else
echo ' *LMK cannot currently be modified on your Kernel* '
fi
echo ·TCP Values
string2=/proc/sys/net/ipv4/tcp_available_congestion_control
if grep 'westwood' $string2; then
echo westwood > /proc/sys/net/ipv4/tcp_congestion_control
else
echo Westwood not avilable, using Cubic
echo cubic > /proc/sys/net/ipv4/tcp_congestion_control
fi
#Tweaking GPU
sleep 0.4
echo GPU Tweaking
echo msm-adreno-tz > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/governor
if grep -q 'ro.build.version.sdk=25' /system/build.prop; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 510000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
else
echo 560000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
fi
fi
if grep -q 'ro.build.version.sdk=24' /system/build.prop; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 510000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
else
echo 560000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
fi
fi
if grep -q 'ro.build.version.sdk=23' /system/build.prop; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 560000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
else
echo 560000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
fi
else
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 510000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
else
echo 560000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
fi
fi
sleep 1
echo ------------------------------------------------------------
echo 'Project Zhana v4.3' Successfully Applied!
echo "Project Zhana Battery" > /data/system/current_profile
echo You may now tweak them further
echo using EXKM or Kernel Adiutor
echo ------------------------------------------------------------
echo ""
echo " Done, this will be automatically closed..."
sleep 4
#################################################
#Modded by Asiier
#Please say thanks and give proper credits if you're using this profile.
#Credits
#*soniCron *Alcolawl *RogerF81 *Patalao *Mostafa Wael *Senthil360 and all of those that have share their profiles on Nexus 5X/6P Advanced Interactive Tweaks respective threads.

Important are:

Small Cores Tweaks.

echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads

echo 220000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack

echo 307200 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq

echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate

echo 0 729600:76000 960000:99000 1228800:150000 1478400:170000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay

echo 155 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load

echo 22000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boost

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/align_windows

echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse_duration

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy

if [ -e "/sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction" ]; then

chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction

fi

Big Cores Tweaks:

echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads

echo 140000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_slack

echo 1401600 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq

echo 65000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate

echo 32000 940800:85000 1248000:96000 1401600:88000 1632000:80000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay

echo 99 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load

echo 11000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time

echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis

echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif

echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boost

echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/fast_ramp_down

echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/align_windows

echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif

echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load

echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boostpulse_duration

echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy

if [ -e "/sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction" ]; then

chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction

echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction

fi

#Enable Input Boost for LITTLE cluster @729MHz and for BIG cluster @729Hz for 100ms

echo Non-Lineage ROM detected

echo Applying appropriate values.

echo Enabling Input Boost at 729 MHz for the LITTLE cluster and at 0 MHz for the BIG Cluster

if [ -e "/sys/module/cpu_boost/parameters/input_boost_freq" ]; then

chmod 644 /sys/module/cpu_boost/parameters/input_boost_freq

echo 0:729600 1:0 2:0 3:0 > /sys/module/cpu_boost/parameters/input_boost_freq

chmod 644 /sys/module/cpu_boost/parameters/input_boost_ms

echo 77 > /sys/module/cpu_boost/parameters/input_boost_ms

else

echo "*Input Boost is not avalible for your Kernel*"

fi

#echo Tweaking HMP Scheduler for correcting BIG Cluster utilization

echo 2 > /proc/sys/kernel/sched_window_stats_policy

echo 85 > /proc/sys/kernel/sched_upmigrate

echo 62 > /proc/sys/kernel/sched_downmigrate

echo 5 > /proc/sys/kernel/sched_spill_nr_run

echo 100 > /proc/sys/kernel/sched_spill_load

echo 30 > /proc/sys/kernel/sched_init_task_load

it prefers Zen, if not available goes to noop or CFQ

Some Memory tweaks..

cho ·Memory Values

echo 0 > /proc/sys/vm/swappiness

echo 100 > /proc/sys/vm/vfs_cache_pressure

echo 80 > /proc/sys/vm/dirty_ratio

echo 20 > /proc/sys/vm/dirty_background_ratio

echo 4096 > /proc/sys/vm/min_free_kbytes

echo 100 > /proc/sys/vm/dirty_expire_centisecs

echo 250 > /proc/sys/vm/dirty_writeback_centisecs

echo 0 > /proc/sys/vm/oom_kill_allocating_task

echo 3 > /proc/sys/vm/page-cluster

tries to set TCP to westwood if not cubic.

echo msm-adreno-tz > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/governor

Oh... and the whole zip is made for SDK25 or lower so not really O compatible.

So yeah... you'd better set the values you'd want manually instead of relying on a outdated all in one wonder script.