[KERNEL] [4.4.4/CM/(L)] [Bleeding Edge] Unleashed Kernel Series [101u] [2/8/2015]

Which hotplug do you like most in Unleashed?


  • Total voters
    283
Search This thread

defconoi

Senior Member
Oct 31, 2008
3,183
6,077
SCHUYLKILL HAVEN
www.android-unleashed.com
5OZ18Zh.png


Welcome to the Ultimate Unleashed Kernel Series

Welcome to the Future

Description:
The Ultimate Unleashed Kernel is designed for the Best performance possible on the Nexus 4, this kernel is feature packed, smooth, and optimized for performance and daily use. This Kernel Takes the Best of Hellscore, Hellsdr, furnace, inception, Mirage and Faux Kernel's for the ultimate performance on Android L & Kitkat

Main Features:
Much more has been added check commit history here
Bleeding Edge code from CodeAurora
Automatically Installs UKM/Synapse/Busybox/init.d support for ease of use
Kernel Fully Synced with Mainline Linux 3.4.105
Compatible With Kitkat & Android L
MultiRom Supported (kexec hardboot patched)
Quad+1 Hotplugged Kernel 5 of the Best Hotplugs
Backported Linux 3.9y Workqueue for performance/efficiency
The Latest Intelliplug 5.2 by @neobuddy89 & @faux123
The Latest AutoSMP Hotplug by @mrg666
The Latest MSM_Hotplug by @dorimanx, @neobuddy89 & @alucard_24
The Latest Alucard Hotplug by @alucard_24
Asynchronous CPU Core: (Set min/max cpu freq per core, & cpu governor per core)
Per Core CPU Boost control
Per Core minfreq/maxfreq/governor control ;)
Enhanced IntelliThermal by @faux123, @dorimanx, @neobuddy89 & @alucard_24
Power Efficient Workqueue updated to Linux 3.10+
F2FS Filesystem Supported
Linux 3.16 zRam/Zsmalloc with lzo/lz4 Compression
Fully updated OOM Killer and Low Memory Killer to the latest versions, also tweaked to prevent Killing of Dialer, SystemUI, modem & Other core services.
Min Freq:Ultra Low 81mhz
Max Freq: Ultra High 1.94Ghz
CPU Governors: Ondemand, Interactive, Conservative, Intellidemand 5.5, Intelliactive, Darkness, Nightmare, PegasusQ, SLIM w/GPU Boost, Alucard, SmartMax, IntelliMM(new), BLU_ACTIVE(new) & HYPER (default)
TCP: HTCP/HSTCP/HYBLA/VEGAS/SCALABLE/LP/VENO/YEAH/ILLINOIS/WESTWOOD(default)
IO: ROW/BFQ/SIO/DEADLINE/ZEN/VR/NOOP/CFQ/FIOPS(default)
Absolute Latest IntelliPlug 5.0 By @neobuddy89 & @faux123
Latest Intelliactive & Intellidemand 5.5
CPU-Boost via sysfs & touch input
Faux Voltage Control using AK's clock table
Double Tap 2 Wake
Sweep2Dim
Faux Sound Control (Latest)
VFP Hardfloat
Added Ultra Kernel Same Page Merging, because it kicks KSM's ass and boosts speed
Intelli-Battery Thermal Control
OTG
Fast Charging
LCD Linear & Exponential Settings added
Add & enable MSM_SHAREDMEM
Optimized Ondemand
AES Crypto Speed boost & Optimizations
Added Network Speed Tweaks
Fixed some security issues in previous kernels
Entropy Tweaks
Updated SLUB memory optimizations
Updated RCU
Tons of old code removed like PMEM and Drivers that are not necessary
Added Motorola Memutils
ext4 speedups & tweaks
Updated Crypto
Mass Memory optimizations
Mass Futex Optimizations
Crypto Optimizations for encrypted tunnels
Backported 3.16 scheduler updates to reduce IPI storm
Updated LZO/LZ4 Compression to current upstream version
Linaro's Power-Efficient Workqueue
Fully Removed mpdecision, & thermald, now using Neobuddy's latest intelli-thermal
Disabled MSM_Thermal because it was not keeping the temps down and lacks configurable options.(faux's is based on msm_thermal anyways and is much better.
Added F2FS Filesystem support
Added Faux Gamma by request to replace franco's
Added LoUIS API Cache maintenance ops to improve cpu hotplug efficiency/latency
Added Kernel Mode NEON acceleration
Disabled Prima debug for performance
added word-at-a-time ARM API Patches
enabled BPF JIT packet filter
disabled gentle fair sleepers in scheduler
Optimized and Secured AES/SHA1 routines
Updated Hardware Accelerated Random Number Generation from Qualcomm
Backported Codel net scheduler from Mainline Linux and set it as default
Updated all CPU Governors with Latest Code Aurora Forum Code
Added Backported 3.8 Slub memory allocator from Linux 3.8
Added backported RWSEM from Linux 3.11 including lock stealing improvements
Added Backported mutex and rcu locking from Linux 3.10 & 3.8
Added Backported prandom & random updates from Linux 3.13
Built with Latest Linaro Toolchain available with -Ofast optimization
Removed unecessary Kernel debugging that slow down performance
Removed Tons of unneeded modules taking up memory and slowing down Android
Enabled Autogroup scheduler and applied per-uid task grouping for android
Removed PMEM completely, this is a Pure ION Kernel
Added glibc patch to imrpve performance of memcpy and memmove
Added Latest Memory optimizations from Motorola
Added Ultra High Overclocking ability to 1.94GHz Per core
Added Latest OTG code available
Added GPU underclocking down to 27mhz
Added Latest Fast Charge code available
Added GPU Overclocking to 487mhz(400 is default)
Added Latest Franco Interactive GPU governor that replaced Simple GPU Governor
Added Latest Faux Speaker updates.
Added and Enabled Sweep to dim (Sweep over nav buttons left to reduce brightness(even past factory defaults) swipe right to increase.
Added BLX Battery Life extender(does anyone use this?) If so, here ya go
Added Latest AutoSMP Hotplug, (default)
Added Latest Intelli-plug from faux(must disable autosmp in init or Synapse(when @apb_axel fixes it)
Added Latest CPU Voltage control
Added LZ4 ramdisk compression for increased boot speed
Added and enabled KEXEC Hardboot Patch
lz4 fixes & optimizations
Added GPU Voltage control
IO Boost 1 & 2
Added Faux zram
Lowmemorykiller optimizations
Android Zram optimizations
lz4 zRam speed boost
Added Busybox Auto Upgrade/Installer for convenience(no need to flash Busybox any longer).
Added Kernel cleaning script to remove incompatible settings
Completely removed MPDecision & ThermalD because this kernel has better thermal control.
Added Latest Intelli-Plug updates by @neobuddy89
And tons more stuff I forgot, check Synapse for the most options available

Instructions: (do this in order)
  • This must be flashed over a stock ROM kernel, so you must reinstall your ROM prior to flashing, if coming from an AnyKernel kernel, you do not need to do this.
  • Flash SuperSU from here
  • Flash Kernel
  • Profit.

Download:
Kernel Releases

Now you can use your phone as a keyboard/mouse for your computer as well:
Required app: https://play.google.com/store/apps/details?id=remote.hid.keyboard.client


Kernel Folder on androidfilehost:
https://www.androidfilehost.com/?w=files&flid=18189

Older & New Kernel Releases:
https://www.mediafire.com/folder/w52s9fk509dwp/Kernels

Bug Reports:

Please provide bug reports in formats of logcat/dmesg and cat /proc/last_kmsg with a detailed report on how to recreate the issue. If this data is not provided, it may be ignored. Before providing a bug report make sure you are not undervolted too low, overvolted too high, and your settings are cleared.

Some Settings in Synapse are bleeding edge and may not be available, contact @apb_axel to fix them.

Special Thanks to @mrg666, @faux123, @apb_axel, @neobuddy89, ak, @aviz1911, @savoca, @stratosk, @google, @qualcomm, @codeaurora @dorimanx @alucard_24 for the collaboration and excellent code that went into this kernel

Source:
My github

Donations:
Donations are accepted @ this link
Thank you all who have donated so far, make sure you add your nick name or pm me and I will add your name to the op for contributing to this project.
 
Last edited:

defconoi

Senior Member
Oct 31, 2008
3,183
6,077
SCHUYLKILL HAVEN
www.android-unleashed.com
Changelog & Tunables

Changelog:
Commit History

My kernel now deletes /system/bin/mpdecision and /system/bin/thermald which are not needed and interfere with my kernel and automatically removes older busybox, installs latest busybox as well as runs a cleaning script to reset Synapse, FauxClock & Others to make sure the kernel boots up properly without bad settings. FauxClock & Synapse do have a profile saving feature, use that before flashing.

Older Kernel Builds Here

Alucard, Darkness & Nightmare CPU Freq Tunables:

inc_cpu_load_at_min_freq:
This threshold is used as up threshold while sampling at frequencies less than freq_for_responsiveness. Above that, normal inc_cpu_load is used. This gives us an option to make scaling aggressive/relaxed until a frequency and normal for higher frequencies. (Only for Nightmare, Alucard). (Default: 60%)"

inc_cpu_load:
The frequency at which governor scales CPU up. Load big or equal inc_cpu_load: cpu scaled up. (Only for Nightmare, Alucard). (Default: 70%)

dec_cpu_load_at_min_freq:
This threshold is used as down threshold while sampling at frequencies less than freq_responsiveness. Above that, normal dec_cpu_load is used. This gives us an option to make scaling aggressive/relaxed until a frequency and normal for higher frequencies. (Only for Alucard). (Default: 60%)

dec_cpu_load:
The frequency at which governor scales CPU down. Load less than dec_cpu_load: cpu scaled down. (Only for Nightmare, Alucard). (Default: 70%)

freq_for_responsiveness_max:
When current freq is greater than freq_for_responsiviness_max, freq_step_dec will be equal to freq_step_dec_at_max_freq. (Only for Nightmare).

freq_responsiveness:
Until freq_responsiveness, Up Threshold considered for sampling load is inc_cpu_load_at_min_freq. Also during the part where CPU is at maximum load frequency, governor need to find the optimal frequency as the next frequency - which should not trigger up_threshold in the next sampling. When such a frequency_next is found to be a) less than freq_responsiveness b) will not trigger down_threshold in the next sample, then the optimal frequency is set to freq_responsiveness. (Only for Alucard)

pump_inc_step_at_min_freq_1-4:
Governor should increase CPU0 frequency by n step each time CPU load reaches inc_cpu_load_at_min_freq. (Only for Alucard) (Default: 2)"

pump_inc_step_1-4:
Governor should increase CPU0 frequency by n step each time CPU load reaches inc_cpu_load. (Only for Alucard) (Default: 1)"

pump_dec_step_1-4:
Governor should decrease CPU0 frequency by n step each time CPU load reaches dec_cpu_load default 30%

freq_up_brake_at_min_freq:
Brake scale up frequency when load big or equal inc_cpu_load_at_min_freq. (Only for Nightmare). (Default: 20)"

freq_up_brake:
Brake scale up frequency when load big or equal inc_cpu_load. (Only for Nightmare). (Default: 20)"


freq_step_dec:
Defines how much as a percentage of maximum frequency, governor should decrease CPU frequency each time CPU load reaches dec_cpu_load. Only for Nightmare). Default: 10%)

freq_step_dec_at_max_freq:
Defines how much as a percentage of maximum frequency, governor should decrease CPU frequency each time CPU load reaches dec_cpu_load and current freq is greater than freq_for_responsiviness_max. (Only for Nightmare). (Default: 10%)"

cpus_up_rate:
Number of samples to evaluate cpus frequency scaling up when current cpu frequency is greater than freq_responsiveness. (Default: 1)"

cpus_down_rate:
Number of samples to evaluate cpu frequency scaling down when current cpu frequency is greater than freq_responsiveness. (Default: 2)"


Alucard HOTPLUG:

hotplug_sampling_rate:
Sampling Interval, measured in ms. This factor determines how often the governor should poll for CPU usage in terms of frequency and load percentage to make hotplugging decisions. (Default: 30 ms)

hotplug_rate_1_1:
Number of samples to evaluate cpu1 hotplug in. (Default: 1)

hotplug_rate_2_0:
Number of samples to evaluate cpu1 hotplug out. (Default: 5)

hotplug_rate_2_1:
Number of samples to evaluate cpu2 hotplug in. (Default: 2)

hotplug_rate_3_0:
Number of samples to evaluate cpu2 hotplug out. (Default: 5)"

hotplug_rate_3_1:
Number of samples to evaluate cpu3 hotplug in. (Default: 2)

hotplug_rate_4_0:
Number of samples to evaluate cpu3 hotplug out. (Default: 5)

hotplug_freq_1_1:
Up threshold frequency to turn second core On, when some other conditions is also met. ie If (minimum frequency greater than or equal to hotplug_freq 1 1) Hotplug IN Second Core. Higher value corresponds to delay in turning on second core. (Default: 1242.000 kHz)

hotplug_freq_2_0:
Down threshold frequency to turn second core Off, when some other conditions is also met. ie If (maximum frequency less than hotplug_freq 2 0) Hotplug OUT Second Core. Lower value corresponds to delay in turning off second core. (Default: 810.000 kHz)

hotplug_freq_2_1:
Up threshold frequency to turn third core On, when some other conditions is also met. ie If (minimum frequency greater than or equal to hotplug_freq 2 1) Hotplug IN Third Core. Higher value corresponds to delay in turning on Third core. (Default: 1566.000 kHz)

hotplug_freq_3_0:
Down threshold frequency to turn third core Off, when some other conditions is also met. ie If (maximum frequency less than hotplug_freq 3 0) Hotplug OUT Third Core. Lower value corresponds to delay in turning off third core. (Default: 918.000 kHz)

hotplug_freq_3_1:
Up threshold frequency to turn fourth core On, when some other conditions is also met. ie If (minimum frequency greater than or equal to hotplug_freq 3 1) Hotplug IN Fourth Core. Higher value corresponds to delay in turning on Fourth core. (Default: 1566.000 kHz)"

hotplug_freq_4_0:
Down threshold frequency to turn fourth core Off, when some other conditions is also met. ie If (maximum frequency less than hotplug_freq 4 0) Hotplug OUT Fourth Core. Lower value corresponds to delay in turning off fourth core. (Default: 918.000 kHz)"

hotplug_load_1_1:
The CPU load at which governor scales CPU up. Current Load equal or greater than up_load: CPU Hotplug IN. Value corresponding to 101 causes not HOTPLUG IN. (Default: 60%)

hotplug_load_2_0:
The CPU load at which governor scales CPU down. Current Load less than down_load and CPU online greater than 1: CPU Hotplug OUT. Value corresponding to 101 causes immediately HOTPLUG OUT. (Default: 30%)

hotplug_load_2_1:
The CPU load at which governor scales CPU up. Current Load equal or greater than up_load: CPU Hotplug IN. Value corresponding to 101 causes not HOTPLUG IN. (Default: 65%)

hotplug_load_3_0:
The CPU load at which governor scales CPU down. Current Load less than down_load and CPU online greater than 1: CPU Hotplug OUT. Value corresponding to 101 causes immediately HOTPLUG OUT. (Default: 30%)

hotplug_load_3_1:
The CPU load at which governor scales CPU up. Current Load equal or greater than up_load: CPU Hotplug IN. Value corresponding to 101 causes not HOTPLUG IN. (Default: 65%)

hotplug_load_4_0:
The CPU load at which governor scales CPU down. Current Load less than down_load and CPU online greater than 1: CPU Hotplug OUT. Value corresponding to 101 causes immediately HOTPLUG OUT. (Default: 20%)

hotplug_rq_1_1:
Threshold run queue length for second core to turn on. (Default: 100)

hotplug_rq_2_0:
Threshold run queue length for second core to turn off. (Default: 100)

hotplug_rq_2_1:
Threshold run queue length for third core to turn on. (Default: 200)

hotplug_rq_3_0:
Threshold run queue length for third core to turn off. (Default: 200)

hotplug_rq_3_1:
Threshold run queue length for fourth core to turn on. (Default: 300)

hotplug_rq_4_0:
Threshold run queue length for fourth core to turn off. (Default: 300)

maxcoreslimit:
Max CPU's hotplugging limit. (Default: 4)

maxcoreslimit_sleep:
Max CPU's hotplugging limit. (Default: 2)
 
Last edited:

defconoi

Senior Member
Oct 31, 2008
3,183
6,077
SCHUYLKILL HAVEN
www.android-unleashed.com
Tips/Tricks:
This Works great with Temasek CM11 here
Also was especially designed and optimized for Android L here
Also works with CM11/CAF based ROM's, flash the CM11 kernel.

Other governors have been added so you have full control in tweaking your device:
SmartMax, Wheatley and OndemandPlus are more battery efficient than Intelliactive that is default, to compensate with intelliactive, undervolt

Setting a Higher Hysteresis value for IntelliPlug will help with battery, lowering it will improve performance.

Lowering the Intelliactive Boost cores can save battery.

99% of the Kernel features of this rom can be customized and set automatically on boot via init.d, you don't need Synapse if you are a cmd line pro and want to save a little bit of processor time/battery:

contents of /system/etc/init.d/99defcon:
Code:
#!/system/bin/sh
bb=busybox
echo "[defcon] Welcome to Ultimate Kernel Series" | tee /dev/kmsg

# Disable mpdecision & thermald
	stop thermald
	stop mpdecision
	echo 1 > /sys/module/msm_thermal/parameters/enabled
	echo "[defcon] thermald & mpdecision disabled" | tee /dev/kmsg
	echo "[defcon] Intelli-Thermal Enabled!" | tee /dev/kmsg

# Set default hotplug here:
	echo 0 > /sys/module/autosmp/parameters/enabled
	echo 0 > /sys/module/dyn_hotplug/parameters/enabled
	echo 1 > /sys/kernel/intelli_plug/intelli_plug_active
	echo "[defcon] hotplug options set!" | tee /dev/kmsg

# Neobuddy Intelliplug options
# profile selections for full_mode_profile
# 0 balanced 4 cores (default)
# 1 performance 4 cores
# 2 conservative 4 cores saves battery
# 3 disable
# 4 Tri
# 5 Eco
# 6 Strict
# runthreshold default is 722
# hystersis choice 0 thru 16 default is 8
# max_cpus_online <---
# cpus_boosted = max cpus boosted
# max_cpus_online_susp = max cpu's while suspended
	echo "1" > /sys/kernel/intelli_plug/intelli_plug_active
	echo "0" > /sys/kernel/intelli_plug/parameters/full_mode_profile
	echo "4" > /sys/kernel/intelli_plug/max_cpus_online
	echo "1" > /sys/kernel/intelli_plug/min_cpus_online
	echo "3" > /sys/kernel/intelli_plug/cpus_boosted
	echo "1" > /sys/kernel/intelli_plug/max_cpus_online_susp
	echo "722" > /sys/kernel/intelli_plug/parameters/cpu_nr_run_threshold
	echo "8" > /sys/kernel/intelli_plug/parameters/nr_run_hysteresis
	echo "[defcon] Intelliplug fully optimized!" | tee /dev/kmsg

# Stratosk dyn_hotplug Settings
	echo "4" > /sys/module/dyn_hotplug/parameters/max_online
	echo "10" > /sys/module/dyn_hotplug/parameters/down_timer_cnt
	echo "2" > /sys/module/dyn_hotplug/parameters/up_timer_cnt
	echo "25" > /sys/module/dyn_hotplug/parameters/up_threshold
	echo "1" > /sys/module/dyn_hotplug/parameters/min_online
	echo "[defcon] Dyn_hotplug fully optimized!" | tee /dev/kmsg

# Tweak AutoSMP Hotplug
	echo "972000" > /sys/kernel/autosmp/conf/cpufreq_down
	echo "1242000" > /sys/kernel/autosmp/conf/cpufreq_up
	echo 3 > /sys/kernel/autosmp/conf/cycle_down
	echo 1 > /sys/kernel/autosmp/conf/cycle_up
	echo 4 > /sys/kernel/autosmp/conf/max_cpus
	echo 1 > /sys/kernel/autosmp/conf/min_cpus
	echo "100" > /sys/kernel/autosmp/conf/delay
	echo 1 > /sys/kernel/autosmp/conf/scroff_single_core
	echo "[defcon] autosmp fully optimized!" | tee /dev/kmsg

# Set TCP westwood
	echo "westwood" > /proc/sys/net/ipv4/tcp_congestion_control
	echo "[defcon] TCP set: westwood" | tee /dev/kmsg

# Set IntelliActive as default:	
	echo "HYPER" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
	echo "HYPER" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
	echo "HYPER" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
	echo "HYPER" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
	echo "384000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
	echo "384000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
	echo "384000" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
	echo "384000" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
	echo "[defcon] HYPER CPU Governor activated" | tee /dev/kmsg

# Set Power Save Settings
	echo 1 > /sys/module/pm_8x60/modes/cpu0/wfi/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled
	echo 1 > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled
	echo "[defcon] Power saving modes Enabled" | tee /dev/kmsg

# Set IOSched
	echo "fiops" > /sys/block/mmcblk0/queue/scheduler
	echo "2048" > /sys/block/mmcblk0/queue/read_ahead_kb
	echo "[defcon] IOSched set: fiops" | tee /dev/kmsg
	echo "[defcon] IOSched readahead set to: 2048" | tee /dev/kmsg
	
# Sweep2Dim default
	echo "0" > /sys/android_touch/sweep2wake
	echo "1" > /sys/android_touch/sweep2dim
	echo "73" > /sys/module/sweep2wake/parameters/down_kcal
	echo "73" > /sys/module/sweep2wake/parameters/up_kcal
	echo "[defcon] sweep2dim enabled!" | tee /dev/kmsg

# Set RGB KCAL
if [ -e /sys/devices/platform/kcal_ctrl.0/kcal ]; then
	sd_r=255
	sd_g=255
	sd_b=255
	kcal="$sd_r $sd_g $sd_b"
	echo "$kcal" > /sys/devices/platform/kcal_ctrl.0/kcal
	echo "1" > /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
	echo "[defcon] LCD_KCAL: red=[$sd_r], green=[$sd_g], blue=[$sd_b]" | tee /dev/kmsg
fi

# disable sysctl.conf to prevent ROM interference with tunables
	$bb mount -o rw,remount /system
	$bb [ -e /system/etc/sysctl.conf ] && $bb mv -f /system/etc/sysctl.conf /system/etc/sysctl.conf.fkbak

# disable the PowerHAL since there is a kernel-side touch boost implemented
	$bb [ -e /system/lib/hw/power.msm8960.so.fkbak ] || $bb cp /system/lib/hw/power.msm8960.so /system/lib/hw/power.msm8960.so.fkbak
	$bb [ -e /system/lib/hw/power.msm8960.so ] && $bb rm -f /system/lib/hw/power.msm8960.so

# create and set permissions for /system/etc/init.d if it doesn't already exist
	$bb mkdir /system/etc/init.d;
	$bb chown -R root.root /system/etc/init.d;
	$bb chmod -R 775 /system/etc/init.d;
	$bb mount -o ro,remount /system;
	echo "[defcon] init.d permissions set" | tee /dev/kmsg

# Interactive Options
	echo 20000 1300000:40000 1400000:20000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
	echo 85 1300000:90 1400000:70 > /sys/devices/system/cpu/cpufreq/interactive/target_loads

# GPU Max Clock
	echo "400000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk
	echo "[defcon] GPU Max Clock Set" | tee /dev/kmsg

# disable debugging on some modules
	echo "0" > /sys/module/kernel/parameters/initcall_debug;
	echo "0" > /sys/module/alarm/parameters/debug_mask;
	echo "0" > /sys/module/alarm_dev/parameters/debug_mask;
	echo "0" > /sys/module/binder/parameters/debug_mask;
	echo "0" > /sys/module/xt_qtaguid/parameters/debug_mask;

#FS DELAY WRITEBACKS MODE
# This command delays auto fs writebacks  or file system bits cached in RAM while Screen is ON. Enable this feature for better performance.  Note this adds a slight risk of possible data loss if you phone crashes while screen is on.
echo "0" > /proc/sys/vm/laptop_mode

echo "0" > /sys/kernel/sched/gentle_fair_sleepers
echo "1" > /sys/kernel/sched/arch_power
	echo "[defcon] Tweaks completed!" | tee /dev/kmsg

Available CPU Governors Explained:

IntelliActive
Based off Google's Interactive governor with the following enhancements:

1. self-boost capability from input drivers (no need for PowerHAL assist)
2. two phase scheduling (idle/busy phases to prevent from jumping directly to max freq
3. Checks for offline cpus and short circuits some unnecessary checks to improve code execution paths

Intellidemand:
Intellidemand aka Intelligent Ondemand from Faux is yet another governor that's based on ondemand. Unlike what some users believe, this governor is not the replacement for OC Daemon (Having different governors for sleep and awake). The original intellidemand behaves differently according to GPU usage. When GPU is really busy (gaming, maps, benchmarking, etc) intellidemand behaves like ondemand. When GPU is 'idling' (or moderately busy), intellidemand limits max frequency to a step depending on frequencies available in your device/kernel for saving battery. This is called browsing mode. We can see some 'traces' of interactive governor here. Frequency scale-up decision is made based on idling time of CPU. Lower idling time (<20%) causes CPU to scale-up from current frequency. Frequency scale-down happens at steps=5% of max frequency. (This parameter is tunable only in conservative, among the popular governors)
To sum up, this is an intelligent ondemand that enters browsing mode to limit max frequency when GPU is idling, and (exits browsing mode) behaves like ondemand when GPU is busy; to deliver performance for gaming and such. Intellidemand does not jump to highest frequency when screen is off.

Pegasusq

The Pegasus-q is a multi-core based on the Ondemand governor and governor with integrated hot-plugging.
Ongoing processes in the queue, we know that multiple processes can run simultaneously on. These processes are active in an array, which is a field called "Run Queue" queue that is ongoing, with their priority values ​​arranged (priority will be used by the task scheduler, which then decides which process to run next).

To ensure that each process has its fair share of resources, each running for a certain period and will eventually stop and then again placed in the queue until it is your turn again. If a program is terminated, so that others can run the program with the highest priority in the current queue is executed.

Nightmare
A PegasusQ modified, less aggressive and more stable. A good compromise between performance and battery.
In addition to the SoD is a prevention because it usually does not hotplug.

HYPER
The Hyper (formerly known as kenobi) is an aggressive smart and smooth, optimized for SGS2 getweakt and, based on the Ondemand, which was getweakt of Arighi and was equipped with several features of Ondemandx suspend imoseyon. (Added by sysfs, the settings suspend_freq and suspend Imoseyon's code) is the behavior of the hyper Ondemand if he is in action, very similar. He also has the Arighi's fast_start deep_sleep and detection features. In addition, the maximum frequency is in suspend mode 500Mhz.

SmartMax
Well - you did it it 100% correct :)

Some more info

The basic idea - which comes from smartass - is the concept of an "ideal" frequency.

The following strategy is used:
1) If load is above upper-threshold and current frequency is below ideal freq
-> jump to ideal in one step
2) If load is above upper-threshold and current frequency is at or above ideal freq
->do "ramp up" steps which will include all frequencies for a specific
amount of time - so compared to ondemand no "jumping" to max frequency
3) if load is below lower-threshold and current frequency is below ideal freq
->do "ramp down" steps
4) if load is below lower-threshold and current frequency is above ideal freq
-> jump down to ideal in one step

All those thresholds ramp steps and frequency stepping times are
fully configurable using sysfs. By default I tried to create a good balance.

The ideal frequency for "us" is 475000 which is the maximal frequency
of the LP mode of the tegra chip. This will allow using LP mode as much as possible

Additional to make it "snappy" smartmax has "touch poke"
So input events from the touchscreen will boost the cpu for a specific
time to a specific frequency.

BluActive:
Based of Google, CAF, CM, myfluxi and franciscofranco Interactive by @eng.stk

Wheatley:
Building on the classic 'ondemand' governor is implemented Wheatley governor. The governor has two additional parameters:
target_residency - The minimum average residency in µs which is considered acceptable for a proper efficient usage of the C4 state. Default is 10000 = 10ms.
allowed_misses - The number sampling intervals in a row the average residency is allowed to be lower than target_residency before the governor reduces the frequency. This ensures that the governor is not too aggressive in scaling down the frequency and reduces it just because some background process was temporarily causing a larger number of wakeups. The default is 5.
Wheatley works as planned and does not hinder the proper C4 usage for task where the C4 can be used properly .
For internet browsing the time spend in C4 has increased by 10% points and the average residency has increased by about 1ms. I guess these differences are mostly due to the different browsing behaviour (I spend the last time more multi-tabbing). But at least we can say that Wheatley does not interfere with the proper use of the C4 state during 'light' tasks. For music playback with screen off the time spend in C4 is practically unchanged, however the average residency is reduced from around 30ms to around 18ms, but this is still more than acceptable.
So the results show that Wheatley works as intended and ensures that the C4 state is used whenever the task allows a proper efficient usage of the C4 state. For more demanding tasks which cause a large number of wakeups and prevent the efficient usage of the C4 state, the governor resorts to the next best power saving mechanism and scales down the frequency. So with the new highly-flexible Wheatley governor one can have the best of both worlds.
Obviously, this governor is only available on multi-core devices.

OnDemandPlus:
A governor based off of OnDemand and Interactive. It provides a balance between performance, and saving battery.

On boot 99defcon init.d script is executed, modify this for default settings, to override use Synapse
Code:
root@mako:/ # dmesg | grep defcon                                              
<4>[   15.718968] [defcon] Welcome to Ultimate Kernel Series
<4>[   15.803906] [defcon] thermald & mpdecision disabled
<4>[   15.808911] [defcon] Intelli-Thermal Enabled!
<4>[   15.817366] [defcon] hotplug options set!
<4>[   15.822981] [defcon] Intelliplug fully optimized!
<4>[   15.831619] [defcon] Dyn_hotplug fully optimized!
<4>[   15.843338] [defcon] autosmp fully optimized!
<4>[   15.853197] [defcon] TCP set: westwood
<4>[   15.875080] [defcon] HYPER CPU Governor activated
<4>[   15.889455] [defcon] Power saving modes Enabled
<4>[   16.121379] [defcon] IOSched set: fiops
<4>[   16.126201] [defcon] IOSched readahead set to: 2048
<4>[   16.131237] [defcon] sweep2dim enabled!
<4>[   16.136670] [defcon] LCD_KCAL: red=[255], green=[255], blue=[255]
<4>[   16.864153] [defcon] init.d permissions set
<4>[   16.867144] [defcon] GPU Max Clock Set
<4>[   16.871051] [defcon] Tweaks completed!
F2FS is supported, but you need to modify the updater-script:, see here
 
Last edited:

defconoi

Senior Member
Oct 31, 2008
3,183
6,077
SCHUYLKILL HAVEN
www.android-unleashed.com
i was using 63u before while charging the phone on 63u the cpu temp be around 45 degree but on 64u while charging it goes to 55 to 60 degree don"t know why

edit intelli-thermal throttling lower and edit the Hysteresis value higher, and make sure you undervolt to lower temps as well ;)

Flash the Anykernel version in the future, my version for L removes the charging profile that uses lower frequencies to lower temp while charging.

Alternatively you can use FauxClock and set the charging thermal throttle to a temperature you specify ;)
 
Last edited:

himzz0007

Senior Member
Jul 30, 2011
435
44
delhi
edit intelli-thermal throttling lower and edit the Hysteresis value higher, and make sure you undervolt to lower temps as well ;)

Flash the Anykernel version in the future, my version for L removes the charging profile that uses lower frequencies.

my hysteresis value is 8 and intellithermal value are default i don"t use undervolt and two error sseekbar failed...i attach the screen shot
but in 63u no heating issue
 

Attachments

  • Screenshot_2014-08-12-22-40-30.png
    Screenshot_2014-08-12-22-40-30.png
    180.1 KB · Views: 4,819
  • Screenshot_2014-08-12-22-40-47.png
    Screenshot_2014-08-12-22-40-47.png
    141.4 KB · Views: 4,666

defconoi

Senior Member
Oct 31, 2008
3,183
6,077
SCHUYLKILL HAVEN
www.android-unleashed.com
my hysteresis value is 8 and intellithermal value are default i don"t use undervolt and two error sseekbar failed...i attach the screen shot
but in 63u no heating issue
Shout out to @apb_axel to fix UKM, I'll take a look at what may be causing your higher temps. Thanks for letting me know :)
 

bart.found

Senior Member
Feb 20, 2014
942
351
42
Scicli
Your welcome, thankyou guys who are coming from the Android L Bunny stew thread! Let me know if anyone has any feature requests, and I'll look them over and possibly implement them.

The kernel is just awesome! Full of features and reliable.. Not a single issue till now! I used AK when I was on KitKat, but now I'm using L as daily driver.. The only thing I really miss from AK kernel (one of my favorites for mako) is GPU undervolt..

I also noticed that threads about governors are quite outdated.. A micro guide to explain which are performance/battery/balanced oriented will be welcome! XD
 
  • Like
Reactions: kaninchenkatze.tt

himzz0007

Senior Member
Jul 30, 2011
435
44
delhi
Shout out to @apb_axel to fix UKM, I'll take a look at what may be causing your higher temps. Thanks for letting me know :)

i agian install 64u kernel..and i was using daydream clock on charging may be that was causing heating sorry abt that..now the temp is around 47 degree approx.....but i have one problem in synapse i attach the screenshot when i close synapse and open it...it reset defer sampling all the time......thanx for listening:laugh::eek:
should i use your ukm
 

Attachments

  • Screenshot_2014-08-12-22-53-30.png
    Screenshot_2014-08-12-22-53-30.png
    137.1 KB · Views: 1,337
Last edited:

defconoi

Senior Member
Oct 31, 2008
3,183
6,077
SCHUYLKILL HAVEN
www.android-unleashed.com
i agian install 64u kernel..now the temp is around 47 degree approx.....but i have one problem in synapse i attach the screenshot when i close synapse and open it...it reset defer sampling all the time......thanx for listening:laugh::eek:
should i use your ukm

@apb_axel needs to fix UKM, setting this via terminal works fine, my UKM is outdated, use UKM 3.1 since my changes went into 3.1
 
  • Like
Reactions: himzz0007

xenyz

Senior Member
Oct 30, 2010
1,368
1,446
@defconoi nice work here, checking it out now.

I noticed that the init.d support is done through install-recovery-2.sh, which doesn't get run with clockworkmod's superuser. Perhaps consider using term-init in the installer, as it won't overwrite anything and installs correctly for both SuperSU and superuser?
 

Almayce

Senior Member
Jan 21, 2014
465
191
Trying it right now, pretty excited about this. Will report later with battery, so far the performance is very good.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 183
    5OZ18Zh.png


    Welcome to the Ultimate Unleashed Kernel Series

    Welcome to the Future

    Description:
    The Ultimate Unleashed Kernel is designed for the Best performance possible on the Nexus 4, this kernel is feature packed, smooth, and optimized for performance and daily use. This Kernel Takes the Best of Hellscore, Hellsdr, furnace, inception, Mirage and Faux Kernel's for the ultimate performance on Android L & Kitkat

    Main Features:
    Much more has been added check commit history here
    Bleeding Edge code from CodeAurora
    Automatically Installs UKM/Synapse/Busybox/init.d support for ease of use
    Kernel Fully Synced with Mainline Linux 3.4.105
    Compatible With Kitkat & Android L
    MultiRom Supported (kexec hardboot patched)
    Quad+1 Hotplugged Kernel 5 of the Best Hotplugs
    Backported Linux 3.9y Workqueue for performance/efficiency
    The Latest Intelliplug 5.2 by @neobuddy89 & @faux123
    The Latest AutoSMP Hotplug by @mrg666
    The Latest MSM_Hotplug by @dorimanx, @neobuddy89 & @alucard_24
    The Latest Alucard Hotplug by @alucard_24
    Asynchronous CPU Core: (Set min/max cpu freq per core, & cpu governor per core)
    Per Core CPU Boost control
    Per Core minfreq/maxfreq/governor control ;)
    Enhanced IntelliThermal by @faux123, @dorimanx, @neobuddy89 & @alucard_24
    Power Efficient Workqueue updated to Linux 3.10+
    F2FS Filesystem Supported
    Linux 3.16 zRam/Zsmalloc with lzo/lz4 Compression
    Fully updated OOM Killer and Low Memory Killer to the latest versions, also tweaked to prevent Killing of Dialer, SystemUI, modem & Other core services.
    Min Freq:Ultra Low 81mhz
    Max Freq: Ultra High 1.94Ghz
    CPU Governors: Ondemand, Interactive, Conservative, Intellidemand 5.5, Intelliactive, Darkness, Nightmare, PegasusQ, SLIM w/GPU Boost, Alucard, SmartMax, IntelliMM(new), BLU_ACTIVE(new) & HYPER (default)
    TCP: HTCP/HSTCP/HYBLA/VEGAS/SCALABLE/LP/VENO/YEAH/ILLINOIS/WESTWOOD(default)
    IO: ROW/BFQ/SIO/DEADLINE/ZEN/VR/NOOP/CFQ/FIOPS(default)
    Absolute Latest IntelliPlug 5.0 By @neobuddy89 & @faux123
    Latest Intelliactive & Intellidemand 5.5
    CPU-Boost via sysfs & touch input
    Faux Voltage Control using AK's clock table
    Double Tap 2 Wake
    Sweep2Dim
    Faux Sound Control (Latest)
    VFP Hardfloat
    Added Ultra Kernel Same Page Merging, because it kicks KSM's ass and boosts speed
    Intelli-Battery Thermal Control
    OTG
    Fast Charging
    LCD Linear & Exponential Settings added
    Add & enable MSM_SHAREDMEM
    Optimized Ondemand
    AES Crypto Speed boost & Optimizations
    Added Network Speed Tweaks
    Fixed some security issues in previous kernels
    Entropy Tweaks
    Updated SLUB memory optimizations
    Updated RCU
    Tons of old code removed like PMEM and Drivers that are not necessary
    Added Motorola Memutils
    ext4 speedups & tweaks
    Updated Crypto
    Mass Memory optimizations
    Mass Futex Optimizations
    Crypto Optimizations for encrypted tunnels
    Backported 3.16 scheduler updates to reduce IPI storm
    Updated LZO/LZ4 Compression to current upstream version
    Linaro's Power-Efficient Workqueue
    Fully Removed mpdecision, & thermald, now using Neobuddy's latest intelli-thermal
    Disabled MSM_Thermal because it was not keeping the temps down and lacks configurable options.(faux's is based on msm_thermal anyways and is much better.
    Added F2FS Filesystem support
    Added Faux Gamma by request to replace franco's
    Added LoUIS API Cache maintenance ops to improve cpu hotplug efficiency/latency
    Added Kernel Mode NEON acceleration
    Disabled Prima debug for performance
    added word-at-a-time ARM API Patches
    enabled BPF JIT packet filter
    disabled gentle fair sleepers in scheduler
    Optimized and Secured AES/SHA1 routines
    Updated Hardware Accelerated Random Number Generation from Qualcomm
    Backported Codel net scheduler from Mainline Linux and set it as default
    Updated all CPU Governors with Latest Code Aurora Forum Code
    Added Backported 3.8 Slub memory allocator from Linux 3.8
    Added backported RWSEM from Linux 3.11 including lock stealing improvements
    Added Backported mutex and rcu locking from Linux 3.10 & 3.8
    Added Backported prandom & random updates from Linux 3.13
    Built with Latest Linaro Toolchain available with -Ofast optimization
    Removed unecessary Kernel debugging that slow down performance
    Removed Tons of unneeded modules taking up memory and slowing down Android
    Enabled Autogroup scheduler and applied per-uid task grouping for android
    Removed PMEM completely, this is a Pure ION Kernel
    Added glibc patch to imrpve performance of memcpy and memmove
    Added Latest Memory optimizations from Motorola
    Added Ultra High Overclocking ability to 1.94GHz Per core
    Added Latest OTG code available
    Added GPU underclocking down to 27mhz
    Added Latest Fast Charge code available
    Added GPU Overclocking to 487mhz(400 is default)
    Added Latest Franco Interactive GPU governor that replaced Simple GPU Governor
    Added Latest Faux Speaker updates.
    Added and Enabled Sweep to dim (Sweep over nav buttons left to reduce brightness(even past factory defaults) swipe right to increase.
    Added BLX Battery Life extender(does anyone use this?) If so, here ya go
    Added Latest AutoSMP Hotplug, (default)
    Added Latest Intelli-plug from faux(must disable autosmp in init or Synapse(when @apb_axel fixes it)
    Added Latest CPU Voltage control
    Added LZ4 ramdisk compression for increased boot speed
    Added and enabled KEXEC Hardboot Patch
    lz4 fixes & optimizations
    Added GPU Voltage control
    IO Boost 1 & 2
    Added Faux zram
    Lowmemorykiller optimizations
    Android Zram optimizations
    lz4 zRam speed boost
    Added Busybox Auto Upgrade/Installer for convenience(no need to flash Busybox any longer).
    Added Kernel cleaning script to remove incompatible settings
    Completely removed MPDecision & ThermalD because this kernel has better thermal control.
    Added Latest Intelli-Plug updates by @neobuddy89
    And tons more stuff I forgot, check Synapse for the most options available

    Instructions: (do this in order)
    • This must be flashed over a stock ROM kernel, so you must reinstall your ROM prior to flashing, if coming from an AnyKernel kernel, you do not need to do this.
    • Flash SuperSU from here
    • Flash Kernel
    • Profit.

    Download:
    Kernel Releases

    Now you can use your phone as a keyboard/mouse for your computer as well:
    Required app: https://play.google.com/store/apps/details?id=remote.hid.keyboard.client


    Kernel Folder on androidfilehost:
    https://www.androidfilehost.com/?w=files&flid=18189

    Older & New Kernel Releases:
    https://www.mediafire.com/folder/w52s9fk509dwp/Kernels

    Bug Reports:

    Please provide bug reports in formats of logcat/dmesg and cat /proc/last_kmsg with a detailed report on how to recreate the issue. If this data is not provided, it may be ignored. Before providing a bug report make sure you are not undervolted too low, overvolted too high, and your settings are cleared.

    Some Settings in Synapse are bleeding edge and may not be available, contact @apb_axel to fix them.

    Special Thanks to @mrg666, @faux123, @apb_axel, @neobuddy89, ak, @aviz1911, @savoca, @stratosk, @google, @qualcomm, @codeaurora @dorimanx @alucard_24 for the collaboration and excellent code that went into this kernel

    Source:
    My github

    Donations:
    Donations are accepted @ this link
    Thank you all who have donated so far, make sure you add your nick name or pm me and I will add your name to the op for contributing to this project.
    47
    Changelog & Tunables

    Changelog:
    Commit History

    My kernel now deletes /system/bin/mpdecision and /system/bin/thermald which are not needed and interfere with my kernel and automatically removes older busybox, installs latest busybox as well as runs a cleaning script to reset Synapse, FauxClock & Others to make sure the kernel boots up properly without bad settings. FauxClock & Synapse do have a profile saving feature, use that before flashing.

    Older Kernel Builds Here

    Alucard, Darkness & Nightmare CPU Freq Tunables:

    inc_cpu_load_at_min_freq:
    This threshold is used as up threshold while sampling at frequencies less than freq_for_responsiveness. Above that, normal inc_cpu_load is used. This gives us an option to make scaling aggressive/relaxed until a frequency and normal for higher frequencies. (Only for Nightmare, Alucard). (Default: 60%)"

    inc_cpu_load:
    The frequency at which governor scales CPU up. Load big or equal inc_cpu_load: cpu scaled up. (Only for Nightmare, Alucard). (Default: 70%)

    dec_cpu_load_at_min_freq:
    This threshold is used as down threshold while sampling at frequencies less than freq_responsiveness. Above that, normal dec_cpu_load is used. This gives us an option to make scaling aggressive/relaxed until a frequency and normal for higher frequencies. (Only for Alucard). (Default: 60%)

    dec_cpu_load:
    The frequency at which governor scales CPU down. Load less than dec_cpu_load: cpu scaled down. (Only for Nightmare, Alucard). (Default: 70%)

    freq_for_responsiveness_max:
    When current freq is greater than freq_for_responsiviness_max, freq_step_dec will be equal to freq_step_dec_at_max_freq. (Only for Nightmare).

    freq_responsiveness:
    Until freq_responsiveness, Up Threshold considered for sampling load is inc_cpu_load_at_min_freq. Also during the part where CPU is at maximum load frequency, governor need to find the optimal frequency as the next frequency - which should not trigger up_threshold in the next sampling. When such a frequency_next is found to be a) less than freq_responsiveness b) will not trigger down_threshold in the next sample, then the optimal frequency is set to freq_responsiveness. (Only for Alucard)

    pump_inc_step_at_min_freq_1-4:
    Governor should increase CPU0 frequency by n step each time CPU load reaches inc_cpu_load_at_min_freq. (Only for Alucard) (Default: 2)"

    pump_inc_step_1-4:
    Governor should increase CPU0 frequency by n step each time CPU load reaches inc_cpu_load. (Only for Alucard) (Default: 1)"

    pump_dec_step_1-4:
    Governor should decrease CPU0 frequency by n step each time CPU load reaches dec_cpu_load default 30%

    freq_up_brake_at_min_freq:
    Brake scale up frequency when load big or equal inc_cpu_load_at_min_freq. (Only for Nightmare). (Default: 20)"

    freq_up_brake:
    Brake scale up frequency when load big or equal inc_cpu_load. (Only for Nightmare). (Default: 20)"


    freq_step_dec:
    Defines how much as a percentage of maximum frequency, governor should decrease CPU frequency each time CPU load reaches dec_cpu_load. Only for Nightmare). Default: 10%)

    freq_step_dec_at_max_freq:
    Defines how much as a percentage of maximum frequency, governor should decrease CPU frequency each time CPU load reaches dec_cpu_load and current freq is greater than freq_for_responsiviness_max. (Only for Nightmare). (Default: 10%)"

    cpus_up_rate:
    Number of samples to evaluate cpus frequency scaling up when current cpu frequency is greater than freq_responsiveness. (Default: 1)"

    cpus_down_rate:
    Number of samples to evaluate cpu frequency scaling down when current cpu frequency is greater than freq_responsiveness. (Default: 2)"


    Alucard HOTPLUG:

    hotplug_sampling_rate:
    Sampling Interval, measured in ms. This factor determines how often the governor should poll for CPU usage in terms of frequency and load percentage to make hotplugging decisions. (Default: 30 ms)

    hotplug_rate_1_1:
    Number of samples to evaluate cpu1 hotplug in. (Default: 1)

    hotplug_rate_2_0:
    Number of samples to evaluate cpu1 hotplug out. (Default: 5)

    hotplug_rate_2_1:
    Number of samples to evaluate cpu2 hotplug in. (Default: 2)

    hotplug_rate_3_0:
    Number of samples to evaluate cpu2 hotplug out. (Default: 5)"

    hotplug_rate_3_1:
    Number of samples to evaluate cpu3 hotplug in. (Default: 2)

    hotplug_rate_4_0:
    Number of samples to evaluate cpu3 hotplug out. (Default: 5)

    hotplug_freq_1_1:
    Up threshold frequency to turn second core On, when some other conditions is also met. ie If (minimum frequency greater than or equal to hotplug_freq 1 1) Hotplug IN Second Core. Higher value corresponds to delay in turning on second core. (Default: 1242.000 kHz)

    hotplug_freq_2_0:
    Down threshold frequency to turn second core Off, when some other conditions is also met. ie If (maximum frequency less than hotplug_freq 2 0) Hotplug OUT Second Core. Lower value corresponds to delay in turning off second core. (Default: 810.000 kHz)

    hotplug_freq_2_1:
    Up threshold frequency to turn third core On, when some other conditions is also met. ie If (minimum frequency greater than or equal to hotplug_freq 2 1) Hotplug IN Third Core. Higher value corresponds to delay in turning on Third core. (Default: 1566.000 kHz)

    hotplug_freq_3_0:
    Down threshold frequency to turn third core Off, when some other conditions is also met. ie If (maximum frequency less than hotplug_freq 3 0) Hotplug OUT Third Core. Lower value corresponds to delay in turning off third core. (Default: 918.000 kHz)

    hotplug_freq_3_1:
    Up threshold frequency to turn fourth core On, when some other conditions is also met. ie If (minimum frequency greater than or equal to hotplug_freq 3 1) Hotplug IN Fourth Core. Higher value corresponds to delay in turning on Fourth core. (Default: 1566.000 kHz)"

    hotplug_freq_4_0:
    Down threshold frequency to turn fourth core Off, when some other conditions is also met. ie If (maximum frequency less than hotplug_freq 4 0) Hotplug OUT Fourth Core. Lower value corresponds to delay in turning off fourth core. (Default: 918.000 kHz)"

    hotplug_load_1_1:
    The CPU load at which governor scales CPU up. Current Load equal or greater than up_load: CPU Hotplug IN. Value corresponding to 101 causes not HOTPLUG IN. (Default: 60%)

    hotplug_load_2_0:
    The CPU load at which governor scales CPU down. Current Load less than down_load and CPU online greater than 1: CPU Hotplug OUT. Value corresponding to 101 causes immediately HOTPLUG OUT. (Default: 30%)

    hotplug_load_2_1:
    The CPU load at which governor scales CPU up. Current Load equal or greater than up_load: CPU Hotplug IN. Value corresponding to 101 causes not HOTPLUG IN. (Default: 65%)

    hotplug_load_3_0:
    The CPU load at which governor scales CPU down. Current Load less than down_load and CPU online greater than 1: CPU Hotplug OUT. Value corresponding to 101 causes immediately HOTPLUG OUT. (Default: 30%)

    hotplug_load_3_1:
    The CPU load at which governor scales CPU up. Current Load equal or greater than up_load: CPU Hotplug IN. Value corresponding to 101 causes not HOTPLUG IN. (Default: 65%)

    hotplug_load_4_0:
    The CPU load at which governor scales CPU down. Current Load less than down_load and CPU online greater than 1: CPU Hotplug OUT. Value corresponding to 101 causes immediately HOTPLUG OUT. (Default: 20%)

    hotplug_rq_1_1:
    Threshold run queue length for second core to turn on. (Default: 100)

    hotplug_rq_2_0:
    Threshold run queue length for second core to turn off. (Default: 100)

    hotplug_rq_2_1:
    Threshold run queue length for third core to turn on. (Default: 200)

    hotplug_rq_3_0:
    Threshold run queue length for third core to turn off. (Default: 200)

    hotplug_rq_3_1:
    Threshold run queue length for fourth core to turn on. (Default: 300)

    hotplug_rq_4_0:
    Threshold run queue length for fourth core to turn off. (Default: 300)

    maxcoreslimit:
    Max CPU's hotplugging limit. (Default: 4)

    maxcoreslimit_sleep:
    Max CPU's hotplugging limit. (Default: 2)
    40
    Tips/Tricks:
    This Works great with Temasek CM11 here
    Also was especially designed and optimized for Android L here
    Also works with CM11/CAF based ROM's, flash the CM11 kernel.

    Other governors have been added so you have full control in tweaking your device:
    SmartMax, Wheatley and OndemandPlus are more battery efficient than Intelliactive that is default, to compensate with intelliactive, undervolt

    Setting a Higher Hysteresis value for IntelliPlug will help with battery, lowering it will improve performance.

    Lowering the Intelliactive Boost cores can save battery.

    99% of the Kernel features of this rom can be customized and set automatically on boot via init.d, you don't need Synapse if you are a cmd line pro and want to save a little bit of processor time/battery:

    contents of /system/etc/init.d/99defcon:
    Code:
    #!/system/bin/sh
    bb=busybox
    echo "[defcon] Welcome to Ultimate Kernel Series" | tee /dev/kmsg
    
    # Disable mpdecision & thermald
    	stop thermald
    	stop mpdecision
    	echo 1 > /sys/module/msm_thermal/parameters/enabled
    	echo "[defcon] thermald & mpdecision disabled" | tee /dev/kmsg
    	echo "[defcon] Intelli-Thermal Enabled!" | tee /dev/kmsg
    
    # Set default hotplug here:
    	echo 0 > /sys/module/autosmp/parameters/enabled
    	echo 0 > /sys/module/dyn_hotplug/parameters/enabled
    	echo 1 > /sys/kernel/intelli_plug/intelli_plug_active
    	echo "[defcon] hotplug options set!" | tee /dev/kmsg
    
    # Neobuddy Intelliplug options
    # profile selections for full_mode_profile
    # 0 balanced 4 cores (default)
    # 1 performance 4 cores
    # 2 conservative 4 cores saves battery
    # 3 disable
    # 4 Tri
    # 5 Eco
    # 6 Strict
    # runthreshold default is 722
    # hystersis choice 0 thru 16 default is 8
    # max_cpus_online <---
    # cpus_boosted = max cpus boosted
    # max_cpus_online_susp = max cpu's while suspended
    	echo "1" > /sys/kernel/intelli_plug/intelli_plug_active
    	echo "0" > /sys/kernel/intelli_plug/parameters/full_mode_profile
    	echo "4" > /sys/kernel/intelli_plug/max_cpus_online
    	echo "1" > /sys/kernel/intelli_plug/min_cpus_online
    	echo "3" > /sys/kernel/intelli_plug/cpus_boosted
    	echo "1" > /sys/kernel/intelli_plug/max_cpus_online_susp
    	echo "722" > /sys/kernel/intelli_plug/parameters/cpu_nr_run_threshold
    	echo "8" > /sys/kernel/intelli_plug/parameters/nr_run_hysteresis
    	echo "[defcon] Intelliplug fully optimized!" | tee /dev/kmsg
    
    # Stratosk dyn_hotplug Settings
    	echo "4" > /sys/module/dyn_hotplug/parameters/max_online
    	echo "10" > /sys/module/dyn_hotplug/parameters/down_timer_cnt
    	echo "2" > /sys/module/dyn_hotplug/parameters/up_timer_cnt
    	echo "25" > /sys/module/dyn_hotplug/parameters/up_threshold
    	echo "1" > /sys/module/dyn_hotplug/parameters/min_online
    	echo "[defcon] Dyn_hotplug fully optimized!" | tee /dev/kmsg
    
    # Tweak AutoSMP Hotplug
    	echo "972000" > /sys/kernel/autosmp/conf/cpufreq_down
    	echo "1242000" > /sys/kernel/autosmp/conf/cpufreq_up
    	echo 3 > /sys/kernel/autosmp/conf/cycle_down
    	echo 1 > /sys/kernel/autosmp/conf/cycle_up
    	echo 4 > /sys/kernel/autosmp/conf/max_cpus
    	echo 1 > /sys/kernel/autosmp/conf/min_cpus
    	echo "100" > /sys/kernel/autosmp/conf/delay
    	echo 1 > /sys/kernel/autosmp/conf/scroff_single_core
    	echo "[defcon] autosmp fully optimized!" | tee /dev/kmsg
    
    # Set TCP westwood
    	echo "westwood" > /proc/sys/net/ipv4/tcp_congestion_control
    	echo "[defcon] TCP set: westwood" | tee /dev/kmsg
    
    # Set IntelliActive as default:	
    	echo "HYPER" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    	echo "HYPER" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
    	echo "HYPER" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
    	echo "HYPER" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
    	echo "384000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    	echo "384000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
    	echo "384000" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
    	echo "384000" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
    	echo "[defcon] HYPER CPU Governor activated" | tee /dev/kmsg
    
    # Set Power Save Settings
    	echo 1 > /sys/module/pm_8x60/modes/cpu0/wfi/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled
    	echo 1 > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled
    	echo "[defcon] Power saving modes Enabled" | tee /dev/kmsg
    
    # Set IOSched
    	echo "fiops" > /sys/block/mmcblk0/queue/scheduler
    	echo "2048" > /sys/block/mmcblk0/queue/read_ahead_kb
    	echo "[defcon] IOSched set: fiops" | tee /dev/kmsg
    	echo "[defcon] IOSched readahead set to: 2048" | tee /dev/kmsg
    	
    # Sweep2Dim default
    	echo "0" > /sys/android_touch/sweep2wake
    	echo "1" > /sys/android_touch/sweep2dim
    	echo "73" > /sys/module/sweep2wake/parameters/down_kcal
    	echo "73" > /sys/module/sweep2wake/parameters/up_kcal
    	echo "[defcon] sweep2dim enabled!" | tee /dev/kmsg
    
    # Set RGB KCAL
    if [ -e /sys/devices/platform/kcal_ctrl.0/kcal ]; then
    	sd_r=255
    	sd_g=255
    	sd_b=255
    	kcal="$sd_r $sd_g $sd_b"
    	echo "$kcal" > /sys/devices/platform/kcal_ctrl.0/kcal
    	echo "1" > /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
    	echo "[defcon] LCD_KCAL: red=[$sd_r], green=[$sd_g], blue=[$sd_b]" | tee /dev/kmsg
    fi
    
    # disable sysctl.conf to prevent ROM interference with tunables
    	$bb mount -o rw,remount /system
    	$bb [ -e /system/etc/sysctl.conf ] && $bb mv -f /system/etc/sysctl.conf /system/etc/sysctl.conf.fkbak
    
    # disable the PowerHAL since there is a kernel-side touch boost implemented
    	$bb [ -e /system/lib/hw/power.msm8960.so.fkbak ] || $bb cp /system/lib/hw/power.msm8960.so /system/lib/hw/power.msm8960.so.fkbak
    	$bb [ -e /system/lib/hw/power.msm8960.so ] && $bb rm -f /system/lib/hw/power.msm8960.so
    
    # create and set permissions for /system/etc/init.d if it doesn't already exist
    	$bb mkdir /system/etc/init.d;
    	$bb chown -R root.root /system/etc/init.d;
    	$bb chmod -R 775 /system/etc/init.d;
    	$bb mount -o ro,remount /system;
    	echo "[defcon] init.d permissions set" | tee /dev/kmsg
    
    # Interactive Options
    	echo 20000 1300000:40000 1400000:20000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
    	echo 85 1300000:90 1400000:70 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
    
    # GPU Max Clock
    	echo "400000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk
    	echo "[defcon] GPU Max Clock Set" | tee /dev/kmsg
    
    # disable debugging on some modules
    	echo "0" > /sys/module/kernel/parameters/initcall_debug;
    	echo "0" > /sys/module/alarm/parameters/debug_mask;
    	echo "0" > /sys/module/alarm_dev/parameters/debug_mask;
    	echo "0" > /sys/module/binder/parameters/debug_mask;
    	echo "0" > /sys/module/xt_qtaguid/parameters/debug_mask;
    
    #FS DELAY WRITEBACKS MODE
    # This command delays auto fs writebacks  or file system bits cached in RAM while Screen is ON. Enable this feature for better performance.  Note this adds a slight risk of possible data loss if you phone crashes while screen is on.
    echo "0" > /proc/sys/vm/laptop_mode
    
    echo "0" > /sys/kernel/sched/gentle_fair_sleepers
    echo "1" > /sys/kernel/sched/arch_power
    	echo "[defcon] Tweaks completed!" | tee /dev/kmsg

    Available CPU Governors Explained:

    IntelliActive
    Based off Google's Interactive governor with the following enhancements:

    1. self-boost capability from input drivers (no need for PowerHAL assist)
    2. two phase scheduling (idle/busy phases to prevent from jumping directly to max freq
    3. Checks for offline cpus and short circuits some unnecessary checks to improve code execution paths

    Intellidemand:
    Intellidemand aka Intelligent Ondemand from Faux is yet another governor that's based on ondemand. Unlike what some users believe, this governor is not the replacement for OC Daemon (Having different governors for sleep and awake). The original intellidemand behaves differently according to GPU usage. When GPU is really busy (gaming, maps, benchmarking, etc) intellidemand behaves like ondemand. When GPU is 'idling' (or moderately busy), intellidemand limits max frequency to a step depending on frequencies available in your device/kernel for saving battery. This is called browsing mode. We can see some 'traces' of interactive governor here. Frequency scale-up decision is made based on idling time of CPU. Lower idling time (<20%) causes CPU to scale-up from current frequency. Frequency scale-down happens at steps=5% of max frequency. (This parameter is tunable only in conservative, among the popular governors)
    To sum up, this is an intelligent ondemand that enters browsing mode to limit max frequency when GPU is idling, and (exits browsing mode) behaves like ondemand when GPU is busy; to deliver performance for gaming and such. Intellidemand does not jump to highest frequency when screen is off.

    Pegasusq

    The Pegasus-q is a multi-core based on the Ondemand governor and governor with integrated hot-plugging.
    Ongoing processes in the queue, we know that multiple processes can run simultaneously on. These processes are active in an array, which is a field called "Run Queue" queue that is ongoing, with their priority values ​​arranged (priority will be used by the task scheduler, which then decides which process to run next).

    To ensure that each process has its fair share of resources, each running for a certain period and will eventually stop and then again placed in the queue until it is your turn again. If a program is terminated, so that others can run the program with the highest priority in the current queue is executed.

    Nightmare
    A PegasusQ modified, less aggressive and more stable. A good compromise between performance and battery.
    In addition to the SoD is a prevention because it usually does not hotplug.

    HYPER
    The Hyper (formerly known as kenobi) is an aggressive smart and smooth, optimized for SGS2 getweakt and, based on the Ondemand, which was getweakt of Arighi and was equipped with several features of Ondemandx suspend imoseyon. (Added by sysfs, the settings suspend_freq and suspend Imoseyon's code) is the behavior of the hyper Ondemand if he is in action, very similar. He also has the Arighi's fast_start deep_sleep and detection features. In addition, the maximum frequency is in suspend mode 500Mhz.

    SmartMax
    Well - you did it it 100% correct :)

    Some more info

    The basic idea - which comes from smartass - is the concept of an "ideal" frequency.

    The following strategy is used:
    1) If load is above upper-threshold and current frequency is below ideal freq
    -> jump to ideal in one step
    2) If load is above upper-threshold and current frequency is at or above ideal freq
    ->do "ramp up" steps which will include all frequencies for a specific
    amount of time - so compared to ondemand no "jumping" to max frequency
    3) if load is below lower-threshold and current frequency is below ideal freq
    ->do "ramp down" steps
    4) if load is below lower-threshold and current frequency is above ideal freq
    -> jump down to ideal in one step

    All those thresholds ramp steps and frequency stepping times are
    fully configurable using sysfs. By default I tried to create a good balance.

    The ideal frequency for "us" is 475000 which is the maximal frequency
    of the LP mode of the tegra chip. This will allow using LP mode as much as possible

    Additional to make it "snappy" smartmax has "touch poke"
    So input events from the touchscreen will boost the cpu for a specific
    time to a specific frequency.

    BluActive:
    Based of Google, CAF, CM, myfluxi and franciscofranco Interactive by @eng.stk

    Wheatley:
    Building on the classic 'ondemand' governor is implemented Wheatley governor. The governor has two additional parameters:
    target_residency - The minimum average residency in µs which is considered acceptable for a proper efficient usage of the C4 state. Default is 10000 = 10ms.
    allowed_misses - The number sampling intervals in a row the average residency is allowed to be lower than target_residency before the governor reduces the frequency. This ensures that the governor is not too aggressive in scaling down the frequency and reduces it just because some background process was temporarily causing a larger number of wakeups. The default is 5.
    Wheatley works as planned and does not hinder the proper C4 usage for task where the C4 can be used properly .
    For internet browsing the time spend in C4 has increased by 10% points and the average residency has increased by about 1ms. I guess these differences are mostly due to the different browsing behaviour (I spend the last time more multi-tabbing). But at least we can say that Wheatley does not interfere with the proper use of the C4 state during 'light' tasks. For music playback with screen off the time spend in C4 is practically unchanged, however the average residency is reduced from around 30ms to around 18ms, but this is still more than acceptable.
    So the results show that Wheatley works as intended and ensures that the C4 state is used whenever the task allows a proper efficient usage of the C4 state. For more demanding tasks which cause a large number of wakeups and prevent the efficient usage of the C4 state, the governor resorts to the next best power saving mechanism and scales down the frequency. So with the new highly-flexible Wheatley governor one can have the best of both worlds.
    Obviously, this governor is only available on multi-core devices.

    OnDemandPlus:
    A governor based off of OnDemand and Interactive. It provides a balance between performance, and saving battery.

    On boot 99defcon init.d script is executed, modify this for default settings, to override use Synapse
    Code:
    root@mako:/ # dmesg | grep defcon                                              
    <4>[   15.718968] [defcon] Welcome to Ultimate Kernel Series
    <4>[   15.803906] [defcon] thermald & mpdecision disabled
    <4>[   15.808911] [defcon] Intelli-Thermal Enabled!
    <4>[   15.817366] [defcon] hotplug options set!
    <4>[   15.822981] [defcon] Intelliplug fully optimized!
    <4>[   15.831619] [defcon] Dyn_hotplug fully optimized!
    <4>[   15.843338] [defcon] autosmp fully optimized!
    <4>[   15.853197] [defcon] TCP set: westwood
    <4>[   15.875080] [defcon] HYPER CPU Governor activated
    <4>[   15.889455] [defcon] Power saving modes Enabled
    <4>[   16.121379] [defcon] IOSched set: fiops
    <4>[   16.126201] [defcon] IOSched readahead set to: 2048
    <4>[   16.131237] [defcon] sweep2dim enabled!
    <4>[   16.136670] [defcon] LCD_KCAL: red=[255], green=[255], blue=[255]
    <4>[   16.864153] [defcon] init.d permissions set
    <4>[   16.867144] [defcon] GPU Max Clock Set
    <4>[   16.871051] [defcon] Tweaks completed!
    F2FS is supported, but you need to modify the updater-script:, see here
    34
    Kernel Update

    Unleashed 98u Nexus 4 Kernel Changelog:
    • Upgraded to Linux 3.4.105
    • Optimized with ARM Cortex A-15 4.9.3 Linaro Toolchain
    • Backported Linux 3.9y Workqueue with mod_delayed_work(first for mako)
    • Introduce blu_active cpu Governor
    • Overall Performance & Battery Life Increased
    • Optimized & Updated Alucard Hotplug
    • All Hotplugs & Drivers upgraded and Optimized to new workqueue for efficiency & performance
    • Binder: Change MMutex to rtmutex
    • Synapse: Updated live CPU Monitor & Hotplug monitor & Misc performance fixes

    AOSP

    CM11
    33
    Hey guys, will be updating soon, almost got the nexus 5 kernel ready for release, then I'll smooth out nexus 4.