[Moto G General] Pupet_Master:
Hello, i'm using the Sabermod Rom from [MENTION=5270463]beeeto[/MENTION], how ever the settings and script that i would like to share will work for all ROMs/Kernels with the latest Intelliplug and Settings (such as the Spirit Kernel).

The goal is to have a snap on performance when the screen is on.... and a very deep sleep when it is off.

I did the setup with Kernel Adiutor, how ever i did not find it to always apply on boot. So in the end i made a script to be sure that it always run on boot.

Programs that you will need:

Kernel Adiutor: https://play.google.com/store/apps/details?id=com.grarak.kerneladiutor

SManager: https://play.google.com/store/apps/details?id=os.tools.scriptmanager

With the free edition of SManager, make a new script on it (it say new program) then set it to gain SU permisions and to apply on every boot on the script edit window at the program.

Then click to edit the script and put the follow code:

#!/system/bin/sh
chmod "644" /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "192000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod "444" /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod "644" /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo "192000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
chmod "444" /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
chmod "644" /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
echo "192000" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
chmod "444" /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
chmod "644" /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
echo "192000" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
chmod "444" /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
echo "msm-adreno-tz" > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/devfreq/governor
sysctl -w net.ipv4.tcp_congestion_control=reno
stop mpdecision
stop mpdecision
stop mpdecision
echo "1" > /sys/module/intelli_plug/parameters/intelli_plug_active
echo "3" > /sys/module/intelli_plug/parameters/nr_run_profile_sel
echo "3" > /sys/module/intelli_plug/parameters/nr_run_profile_sel
echo "4" > /sys/module/intelli_plug/parameters/nr_run_hysteresis
echo "4" > /sys/module/intelli_plug/parameters/nr_run_hysteresis
echo "550000000" > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/max_gpuclk
echo "192" > sys/module/intelli_plug/parameters/cpu_nr_run_threshold
echo "192" > sys/module/intelli_plug/parameters/cpu_nr_run_threshold
chmod "644" /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "1190400" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod "444" /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod "644" /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo "1190400" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod "444" /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod "644" /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo "1190400" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod "444" /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod "644" /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo "1190400" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
chmod "444" /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo "192000" > /sys/module/cpu_boost/parameters/sync_threshold
echo "192000" > /sys/module/cpu_boost/parameters/sync_threshold
echo "1190400" > /sys/module/cpu_boost/parameters/input_boost_freq
echo "1190400" > /sys/module/cpu_boost/parameters/input_boost_freq
echo "10" > /sys/module/cpu_boost/parameters/input_boost_ms
echo "10" > /sys/module/cpu_boost/parameters/input_boost_ms
echo "10" > /sys/module/cpu_boost/parameters/boost_ms
echo "10" > /sys/module/cpu_boost/parameters/boost_ms
echo "1" > /sys/devices/system/cpu/sched_mc_power_savings
echo "msm-adreno-tz" > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/kgsl/kgsl-3d0/devfreq/governor
echo "550000000" > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/max_gpuclk
echo "1" > /sys/module/simple_gpu_algorithm/parameters/simple_gpu_active
echo "8000" > /sys/module/simple_gpu_algorithm/parameters/simple_ramp_threshold
echo "2" > /sys/module/simple_gpu_algorithm/parameters/simple_laziness
echo "9472,13824,19968,44544,58368,65536" > /sys/module/lowmemorykiller/parameters/minfree
echo "512" > /sys/block/mmcblk0/queue/read_ahead_kb
echo "256" > /sys/block/mmcblk1/queue/read_ahead_kb
sysctl "-w" net.ipv4.tcp_congestion_control=reno
echo "1" > /sys/kernel/mm/ksm/run
echo "0" > /sys/kernel/mm/ksm/deferred_timer
echo "35" > /sys/kernel/mm/ksm/sleep_millisecs
swapoff "/dev/block/zram0/" > dev/null 2>&1
echo "1" /sys/block/zram0/reset
echo "178257920" > sys/block/zram0/disksize
mkswap "/dev/block/zram0/" > dev/null 2>&1
swapon "/dev/block/zram0/" > dev/null 2>&1
echo "0" > sys/kernel/power_suspend/power_suspend_mode
echo "2" > /sys/module/simple_gpu_algorithm/parameters/simple_laziness
echo "1" > /sys/module/simple_gpu_algorithm/parameters/simple_gpu_active
echo "300000" > /sys/module/cpu_boost/parameters/sync_threshold
echo "300000" > /sys/module/cpu_boost/parameters/sync_threshold
echo "300000" > /sys/module/intelli_plug/parameters/screen_off_max
echo "300000" > /sys/module/intelli_plug/parameters/screen_off_max
echo "2" > /sys/module/simple_gpu_algorithm/parameters/simple_laziness
echo "1" > /sys/module/simple_gpu_algorithm/parameters/simple_gpu_active
echo "300000" > /sys/module/cpu_boost/parameters/sync_threshold
echo "300000" > /sys/module/cpu_boost/parameters/sync_threshold
echo "300000" > /sys/module/intelli_plug/parameters/screen_off_max
echo "300000" > /sys/module/intelli_plug/parameters/screen_off_max

echo "1190400" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "67" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "550000" > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
echo "60 787000:70 998000:75 1094000:80 1190400:55" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo "20000 1094000:40000 1190400:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "1000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "1" > /sys/devices/system/cpu/cpufreq/interactive/boostpulse
echo "550000" > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo "-1" > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo "45000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "0" > /sys/devices/system/cpu/cpufreq/interactive/boost
echo "1036800" > /sys/devices/system/cpu/cpufreq/interactive/sync_freq
echo "50" > /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
echo "787000" > /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq

On Kernel Auditor the settings should be the following after run the script:

CPU:

CPU Maximum Frequency: 1190MHz
CPU Governor: Interactive
CPU Minimum Frequency: 300MHz
Multcore Power Saving: Enable
CPUBOOST=
Interval: 10ms
Input Interval: 10ms
Sync Threshold: 300MHz
Input Boost Frequency 1190MHz

CPU Hotplug:

MP Decision: OFF
IntelliPlug=
IntelliPLug: ON
Touch Boost: ON
Threshold Value: 192
Profile: Eco Performance
Hysteresis Value: 4
CPU Maximum Screen Off Frequency: 300MHz.

GPU:

GPU Maximum Frequency: 550MHz
GPU Governor: msm-adreno-tz
Simple GPU Algorithm=
Simple GPU Algorithm: On
Ramp Threshold: 8
Laziness: 2

I/O Scheduler:

Internal Storage=
Scheduler: row
Read-adead: 512kb
External Storage=
Scheduler: rol
Read-Ahead: 256kb

Kernel Samepage Merging

Enable KSM: On
Deferred timer: Off
Sleep between scans: 35ms
Pages to Scan: 100

Low Memory Killer:

Foreground Applications: 37MB
Visible Applications: 54MB
Secondary Server: 78MB
Hidden Applications: 174MB
Contend Providers: 228MB
Empty Applications: 256MB

Virtual Memory:

Disksize: 130MB

Misc Controls:

TCP Congestion Algorithm: reno
Vibration Strenght: 32%
Power Suspend Mode: AutoSleep

UPDATE:

Some settings to tune the Interactive governor:

Already on main script:
echo "1190400" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "67" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "550000" > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
echo "60 787000:70 998000:75 1094000:80 1190400:55" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo "20000 1094000:40000 1190400:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "1000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "1" > /sys/devices/system/cpu/cpufreq/interactive/boostpulse
echo "550000" > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo "-1" > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo "45000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "0" > /sys/devices/system/cpu/cpufreq/interactive/boost
echo "1036800" > /sys/devices/system/cpu/cpufreq/interactive/sync_freq
echo "50" > /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
echo "787000" > /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq

CPU -> CPU Overnor Tunables:
above_highspeed_delay: 20000 1094000:40000 1190400:20000
boost: 0
boostpulse: 1
boostpulse_duration: 550000
go_hispeed_load: 67
hispeed_freq: 1190400
io_is_busy: 1
min_sample_time: 100
sampling_down_factor: 550000
sync_freq: 1036800
target_loads: 60 787000:70 998000:75 1094000:80 1190400:55
timer_rate: 45000
timer_slack: -1
up_threshold_any_cpu_load: 50
up_threshold_any_cpu_freq: 787000

That's it, i would like a feedback on how this settings work for you guys and what would you guys change.