[Lenovo Vibe K5 Plus Guides, News, & Discussion] :
Changelog 03/31:

Cleanup:
- Fixed useless loops and condition checks
- Added credits (developers of Project Zhana/Advanced Kernel Tweaks)
- Typos

Vegito only (unstable):
CPU:
- Timer slack cut in half (from 480000) on big Cluster
- Increased 'go_hispeed_load' (91 -> 400 on big, 91 -> 155 on LITTLE)
- Input Boost duration reduced to 120ms (from 1920ms); (drastically improves battery)
- Input Boost frequency increased to 1113MHz (from 998MHz); should not affect battery much, since it stays on the same voltage
GPU
- Revert 'underclock' (465MHz -> 550MHz) to minimize UI lags, trust Adreno Idler to reduce power consumption.
HMP Scheduler:
- Lower 'sched_upmigrate' (90 -> 85)
- 'sched_freq_dec_notify' decreased (410000 -> 400000)
Virtual Memory:
- Increased ZRam to 256MB (from 128MB)

Changelog 03/30:

HMP Scheduler:
- don't schedule background tasks on big cluster
Virtual Memory - reduce usage of CPU cycles:
- new values from Project X.A.N.A (high dirty_ratio and dirty_background_ratio, min_free at 4M and default vfs_cache_pressure)
IO Scheduler:
- New logic to apply I/O scheduler (from Project X.A.N.A)
- Try ZEN
- if zen is not available use noop (on Lineage OS), otherwise use BFQ.
- increased read-ahead to 512Kb (core_ctl scripts still use 128Kb)
- apply to internal and external memory (SDCard) if present
- changed zen tunables (thanks to [URL=https://xdaforums.com/oneplus-3/how-to/advanced-interactive-governor-tweaks-t3476589][AKT] Advanced Kernel Tweaks[/URL] by [MENTION=6187429]Asiier[/MENTION] - Project X.A.N.A
Cleanup:
- moved verbose descriptions (now at the end of this post)
- Mhz -> MHz

core_ctl only:
CPU:
- target load set to 499Mhz until 75% (from 70%)
Virtual Memory:
- 20 swappiness and 70 vfs_cache_pressure
- page-cluster set to 0 (read only 1 page from swap each attempt)
- Laptop Mode set to 1

Vegito only (unstable):
HMP Scheduler:
- try to use big cluster more, easing the load of the the LITTLE cluster (from [URL=https://xdaforums.com/showpost.php?p=69417941&postcount=724]Project X.A.N.A[/URL]) (*trying different freq_notify values atm)
- big.LITTLE should not overload a single core or cluster.
CPU:
- align_windows set to 0	(both clusters)
- increased min_sample_time (from 0)
- revert 'fix erratic jump to 998Mhz while idle'
Virtual Memory:
- swap only to avoid out of memory conditions ( vm.swappiness = 0 ) # if unstable (e.g. force close), set to a value between 10~60
- lower ZRam (200MB -> 128MB)
- Laptop Mode disabled

Changelog 03/29:

Cleanup:
- add simple function to change permissions and apply settings
- typos
Vegito only:
CPU
- fix erratic jump to 998Mhz while idle

--------------------------

FAQs

How to apply (need root):

Apply every boot.

Using Terminal (RECOMMENDED):

su -c 'sh /script directory/script.sh'

or

su
cd 'script directory/'
sh script.sh

Can be found at Developer Options or you can download one from the Play Store: https://play.google.com/store/apps/details?id=com.termux

Using Kernel Adiutor:

Copy file to /etc/init.d/

Give permissions rwxr-xr-x (0755)

Go to init.d tab on Kernel Adiutor

Execute script.sh

Why do you leave all cores online??11 (vegito)

From: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/index.html

15.1.3. Retention

The core state, including the debug settings, is preserved in low-power structures,
enabling the core to be at least partially turned off. Changing from low-power
retention to running operation does not require a reset of the core. The saved
core state is restored on changing from low-power retention state to running
operation. From an operating system point of view, there is no difference between
a retention state and standby state, other than method of entry, latency and use-related constraints.

Check if you Kernel supports the Core Control (core_ctl) hotplug driver:

These folders must be present:

/sys/devices/system/cpu/cpu0/core_ctl/
/sys/devices/system/cpu/cpu4/core_ctl/

Extreme Kernel (cluster-plug based -> version 12/30 and above)

Try GlassFishCP or FairyTale from https://xdaforums.com/moto-x-play/general/interactive-governor-battery-save-t3443201

Disable Alucard hotplug (to prevent conflicts with cluster-plug)

Disable Simple GPU Algorithm and enable Adreno Idler (Why)

My battery's still crap:

Check if settings were applied correctly.

Try lower input_boost_ms value (at cost of snappiness, can introduce stutter while scrolling)

Check for wakelocks using BetterBatteryStats

Disable Keep Awake/Wi-Fi scan for Google Play Services (unknown side effects):

Settings -> Privacy -> Privacy Guard -> Advanced (dropdown) -> Google Play Services -> Keep Awake/Wi-Fi-Scan

Disable Keep Awake for apps that refuse to sleep, like Facebook and other battery hoggers.

Greenify

General Battery Tips

Disable location when not using

Remove extra widgets from the desktop

Disable live wallpapers

Settings -> Wi-Fi -> Configure -> Keep Wi-Fi on during sleep - Only when plugged in

Settings -> Wi-Fi -> Configure -> uncheck - "Network notification"

Disable unnecessary sync

Disable automatic updates and notifications for updates on Google Play.

Disable push and notification of social networks.

Do not use Task-killers

Do not use programs and widgets to monitor daily usage of the smartphone.

If the quality of the LTE network connection is poor, switch the "Network Type" to 3G or 2G

Source: https://4pda.ru/forum/index.php?showtopic=707426

Obvious:

Use lower brightness (try to keep it below 30%)

Prefer Wi-Fi networks and disable data connections when not using.

Settings explained:

Android Documentation
https://android.googlesource.com/kernel/common/+/android-4.4-n-release/Documentation/
Kernel - Virtual Memory
https://www.kernel.org/doc/Documentation/sysctl/vm.txt
Performance Testing with SSDs Pt. 2 by Toby Chappell Systems
https://devs.mailchimp.com/blog/performance-testing-with-ssds-pt-2/
How is Heterogeneous Multi-Processing (HMP) scheduling implemented in Linux Kernel (Samsung Exynos5422)?
http://stackoverflow.com/questions/25498215/how-is-heterogeneous-multi-processing-hmp-scheduling-implemented-in-linux-kern
Scheduler Documentation (from DTS Eagle Integration into [Code Aurora Forum] Android (kernel))
https://github.com/dtsinc/DTS-Eagle-Integration_CAF-Android-kernel/blob/master/Documentation/scheduler/sched-hmp.txt

# Read-ahead cache
# Typically, larger values increase sequential read speed and slightly reduce the random read speed. The larger the cache, the less growth
and the more compromises.

# Setting rq_affinity to 2 tells the kernel that the specific CPU core that requested the I/O must be the one that completes it.

# add_random with a setting of 0 avoids the overheard of I/O events contributing to the entropy pool in /dev/random.

# Standard I/O elevator operations include attempts to merge contiguous I/Os. For known random I/O loads these attempts will always fail
and result in extra cycles being spent in the kernel. This allows one to turn off this behavior on one of two ways: When set to 1,
complex merge checks are disabled, but the simple one-shot merges with the previous I/O request are enabled. When set to 2, all merge
tries are disabled. The default value is 0 - which enables all types of merge tries.
# https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block

# Laptop mode is used to minimize the time that the hard disk needs to be spun up,
# to conserve battery power. It has been reported to cause significant power savings.

# When the knob is set, any physical disk I/O (that might
# have caused the hard disk to spin up) causes Linux to flush all dirty blocks. The
# result of this is that after a disk has spun down, it will not be spun up
# anymore to write dirty blocks, because those blocks had already been written
# immediately after the most recent read operation. The value of the laptop_mode
# knob determines the time between the occurrence of disk I/O and when the flush
# is triggered.

# A task whose nice value is greater than this tunable value will never be considered as a "big" task (it will not be allowed to run
on a high-performance CPU).
# android background processes are set to nice 10. Never schedule these on the big cluster.
# echo 9 > /proc/sys/kernel/sched_upmigrate_min_nice # 15 default, 9 to never schedule background tasks on big Cluster, and 7
on Project Zhana

Known bugs:

Kernel Adiutor seems to change minimum number of big cores to 2 on Core Control. Avoid checking 'Hotplug' tab when using scripts with core_ctl support (try Kernel Adiutor-Mod if problem persists).