Persistently Setting CPU Frequency - Ubuntu Touch Q&A, Help & Troubleshooting

Persistently setting cpu frequency
I can't seem to set the cpu frequency. I've tried a number of utilities (e.g. cpufreqd / cpufrequtils), as well as just manually editing the cpu frequency using commands like:
Code:
echo performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Doing this works for a short time, but as soon as I do any cpu-intensive work, the file /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq seems to be overwritten.
This doesn't happen if I boot into android, and use an app like SetCPU, and then do the same amount of cpu work.

Related

How to get better performance in games (root required)

I just wanted to share a few tricks i learned to get graphics-intensive games to run much more smoothly. These commands should be run in android terminal emulator as root, in adb shell as root, or ran as a script with any script-running app with root privileges
All of the following is only temporary and will be reset to normal after a reboot
Code:
stop mpdecision
stops the hotplugging binary used to turn on/off extra cpus we want this gone because we want to specify which cpus are online ourselves
Code:
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
turns on the other cpu cores (you probably don't need all 3 extra cores on, just turning cpu1 online makes a big difference)
Code:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
sets all online cpus to maximum frequency
Code:
echo performance > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
sets the gpu to stay at maximum frequency
as a script:
Code:
#!/system/bin/sh
stop mpdecision
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
would this help improve general smoothness across the ui and other apps? Does it reduce the choppiness in the maps app????
It would, but i'm not sure how long the battery would last.
Faux kernel with Faux Clock you can do all this! It is great!
Jeepers. Seems the device gets hot enough without doing this, but what makes the user happy.
rushless said:
Jeepers. Seems the device gets hot enough without doing this, but what makes the user happy.
Click to expand...
Click to collapse
havent noticed mine get that hot at all?
Perhaps subjective to the user. Playing 3d games gets the device hot and OC ing will get it hotter. If the user does not mind, that is what matters.
may add this to the roms/ guides / etc list
bsimpson1 said:
as a script:
Code:
#!/system/bin/sh
stop mpdecision
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
Click to expand...
Click to collapse
You might also want a script for when you're done with gaming. Probably something like:
Code:
#!/system/bin/sh
start mpdecision
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
This way once you're done with gaming/whatever, the phone can go back to scaling down CPU speeds and hotplugging cores to save battery. It's not very useful for an idle phone to have all 4 cores active and running at full speed.
What if I just reboot the phone, would that stop the script(s)? Anyone try the S4 with PSP emulator (PPSSPP)?
IamPro said:
What if I just reboot the phone, would that stop the script(s)? Anyone try the S4 with PSP emulator (PPSSPP)?
Click to expand...
Click to collapse
Rebooting would restart mpdecision, and therefore let your hotplugging go back to working order. I'm not certain it would reset your governor, though. So your phone may still be running at full speed 24/7, even after a reboot.
Cilraaz said:
You might also want a script for when you're done with gaming. Probably something like:
Code:
#!/system/bin/sh
start mpdecision
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
This way once you're done with gaming/whatever, the phone can go back to scaling down CPU speeds and hotplugging cores to save battery. It's not very useful for an idle phone to have all 4 cores active and running at full speed.
Click to expand...
Click to collapse
I don't think start mpdecision will do what you're intending but according to cat "/proc/`pgrep mpdecision`/cmdline" it was started by "mpdecision --nosleep --avg_comp"

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

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
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.
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)
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
maxwen said:
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.
Click to expand...
Click to collapse
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:
[email protected]:/ # 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
A new thread for me to be all over
Sent from my LG-D851
defconoi said:
saved 2
Click to expand...
Click to collapse
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
himzz0007 said:
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
Click to expand...
Click to collapse
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
Finally a dedicate thread for this kernel! Thanks!
bart.found said:
Finally a dedicate thread forma this kernel! Thanks!
Click to expand...
Click to collapse
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.
defconoi said:
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.
Click to expand...
Click to collapse
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
himzz0007 said:
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
Click to expand...
Click to collapse
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
defconoi said:
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.
Click to expand...
Click to collapse
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
defconoi said:
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
Click to expand...
Click to collapse
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:
should i use your ukm
himzz0007 said:
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:
should i use your ukm
Click to expand...
Click to collapse
@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
I'm doomed to follow this thread.
defconoi said:
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.
Click to expand...
Click to collapse
Awwww your welcome.
As far as features , can you make my mako turn into a jetpack?
Or do I not count?
Sent from my LG-D851
sykopompos said:
Awwww your welcome.
As far as features , can you make my mako turn into a jetpack?
Or do I not count?
Sent from my LG-D851
Click to expand...
Click to collapse
I'd prefer you make mine turn into a shower. Handy.
Sent from Nexus 7.2 Flo using Tapatalk.
manueltts said:
I'd prefer you make mine turn into a shower. Handy.
Sent from Nexus 7.2 Flo using Tapatalk.
Click to expand...
Click to collapse
A portable shower would be handy but then you gotta lug water around with you too. Jetpack fuel is lighter
Sent from my LG-D851
@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?
Trying it right now, pretty excited about this. Will report later with battery, so far the performance is very good.
i'm a new to this question
Will updating to this kernel wipe all my setting/contacts data etc...
Thanks

Remix OS running CPU on all cylinders all the time.

My laptop felt kind of warm when I was using Remix, so I installed CPU-Z and checked the main tab. It said that all of my cores were running at near max performance, about 3.4 GHz, at all times, including when idle. Even stranger, according to the app Remix is supposedly running in "Power Saver" mode. If it was running in that mode core speeds would be much lower most of the time. Is there any way to correct this?
Lol...
Asking for support.. without "any" info about your hardware (laptop)
I've noticed this, too. In my case it's a Microsoft Surface Pro 2, with a Haswell based i5. I was initially investigating that Intel P-States weren't being used, but I have not had an opportunity to follow up on it thoroughly. I know on regular Linux with a 4.7 kernel the CPUs all clock down to .8Ghz when not busy. By default, on Remix the CPUs seem to all be running 1.6-2.2Ghz, even if nothing is going on.
This does make the tablet get hot and consumes the battery very fast, so it's not simply a reporting issue.
When I get a chance I'll boot with 'intel_pstate=force' and see if that does anything.
J M L said:
I've noticed this, too. In my case it's a Microsoft Surface Pro 2, with a Haswell based i5. I was initially investigating that Intel P-States weren't being used, but I have not had an opportunity to follow up on it thoroughly. I know on regular Linux with a 4.7 kernel the CPUs all clock down to .8Ghz when not busy. By default, on Remix the CPUs seem to all be running 1.6-2.2Ghz, even if nothing is going on.
This does make the tablet get hot and consumes the battery very fast, so it's not simply a reporting issue.
When I get a chance I'll boot with 'intel_pstate=force' and see if that does anything.
Click to expand...
Click to collapse
i have a 4200u and power management works fine. idles at .8 GHz , util 1%, temp 37-42C. turbo works 1.6-2.3 GHz temp 55-70C. intel_pstates is enabled by default.
intel_pstates may mess up if you disable turbo.
hwmonitor app gives better readings
Intel P-states might be a problem, but it seems to be going the opposite way. By default Remix is using Intel P-states, but the CPU won't clock lower than 1.6Ghz. Booting with "intel_pstate=disable" lets the CPU go down to .8Ghz. That lets things run a bit cooler, but the CPU and package aren't entering power saving states. Powertop made some suggestions:
Code:
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs'
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy'
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save'
echo '0' > '/proc/sys/kernel/nmi_watchdog'
echo 'auto' > '/sys/bus/i2c/devices/i2c-3/device/power/control'
echo 'auto' > '/sys/bus/usb/devices/2-3/power/control'
echo 'auto' > '/sys/bus/usb/devices/2-4/power/control'
echo 'auto' > '/sys/bus/usb/devices/3-1/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-1/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-2/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-0/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-4/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-5/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-6/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-7/device/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:03.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:14.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:16.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control'
Doing all of that lets the CPU enter better power saving states, but it's still won't enter the best power saving states. Linux with the 4.7 kernel does enter package C10, or whatever the best power saving states are.
The biggest issue for me, is that Linux (Remix and regular) frequently hangs a few seconds after waking from sleep. I don't think that's related to the problem of the CPU running too fast.
J M L said:
Intel P-states might be a problem, but it seems to be going the opposite way. By default Remix is using Intel P-states, but the CPU won't clock lower than 1.6Ghz. Booting with "intel_pstate=disable" lets the CPU go down to .8Ghz. That lets things run a bit cooler, but the CPU and package aren't entering power saving states. Powertop made some suggestions:
Doing all of that lets the CPU enter better power saving states, but it's still won't enter the best power saving states. Linux with the 4.7 kernel does enter package C10, or whatever the best power saving states are.
The biggest issue for me, is that Linux (Remix and regular) frequently hangs a few seconds after waking from sleep. I don't think that's related to the problem of the CPU running too fast.
Click to expand...
Click to collapse
working idle intel_pstates
Same thing over here on HP 820 G1 with i7-4600U.
I'm using 3C CPU Management to lock the speed to 800 MHz (lowest possible). It's cooling down my system from ~82°C (180°F) to ~40°C (104°F).
Still enough power to get a 1080 media file from internal NTFS SDD Drive to display flawlessly scaled down to 1366x768 by VLC App.
As I have <10 Posts I cannot link to the store directly... But c'n'p should work.
Maromi said:
working idle intel_pstates
Click to expand...
Click to collapse
I see the same thing as you. Kernel aduitor and cpu-z show the CPUs at 1600, even when they are otherwise idle.
J M L said:
I see the same thing as you. Kernel aduitor and cpu-z show the CPUs at 1600, even when they are otherwise idle.
Click to expand...
Click to collapse
Hwmonitor is the reliable app on the right side, cpuz is there to show what processor is used, settings shows the kernel, and terminal shows c9 is supported and what cpu microcode im using.
Maromi said:
Hwmonitor is the reliable app on the right side, cpuz is there to show what processor is used, settings shows the kernel, and terminal shows c9 is supported and what cpu microcode im using.
Click to expand...
Click to collapse
I double checked, and hwmonitor shows mine sitting at 1600 on all the CPUs, even with CPU usage at 1-3%. I also see c9 is supported, but without making all the changes I referenced above, powertop shows that none except c2 are used.
Booting to a regular Linux install with the 4.6 or 4.7 kernel shows P-states enabled and the CPU idles at 800. The difference is very obvious, as under Remix the tablet is noticeably warmer to the touch, even when sitting idle.
J M L said:
I double checked, and hwmonitor shows mine sitting at 1600 on all the CPUs, even with CPU usage at 1-3%. I also see c9 is supported, but without making all the changes I referenced above, powertop shows that none except c2 are used.
Booting to a regular Linux install with the 4.6 or 4.7 kernel shows P-states enabled and the CPU idles at 800. The difference is very obvious, as under Remix the tablet is noticeably warmer to the touch, even when sitting idle.
Click to expand...
Click to collapse
what powertop are you using cause for android im stuck on the same page regardless of command. all i see is cpu and bios c-states c1-c7
testing with Fedora 24 kernel 4.6.6 supported core c-states and cpu c-states all work.
achieved package c7(pc7) otherwise it would stay on pc2.
see warning in next post about the following settings
Code:
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host3/link_power_management_policy'
so odds are definitely not currently using c7 on remix os
did some reading i know this sucks but there is a legitimate reason why the default settings are what they are.
Warning: SATA Active Link Power Management can lead to data loss on some devices (e.g. Lenovo T440s is known to suffer this problem. Issue is still verified to occur on Linux kernel version 4.5.1. Do not enable this setting unless you have frequent backups.)
source:
https://wiki.archlinux.org/index.php/Power_management#SATA_Active_Link_Power_Management
i did not have any issues with it enabled and added su.d script. can't verify pc7 with powertop in android but i am getting signifigant lower temps in idle.
Maromi said:
what powertop are you using cause for android im stuck on the same page regardless of command. all i see is cpu and bios c-states c1-c7
Click to expand...
Click to collapse
My device dual boots Debian, so I attach the Debian root as a chroot and am using powertop 2.8 from there. That's also why it's easy for me to compare behavior with Remix's kernel and a generic Linux kernel. If I could get the stability of Linux 4.6/4.7 and Remix's interface, I would be very happy.
boppy.de said:
Same thing over here on HP 820 G1 with i7-4600U.
I'm using 3C CPU Management to lock the speed to 800 MHz (lowest possible). It's cooling down my system from ~82°C (180°F) to ~40°C (104°F).
Still enough power to get a 1080 media file from internal NTFS SDD Drive to display flawlessly scaled down to 1366x768 by VLC App.
As I have <10 Posts I cannot link to the store directly... But c'n'p should work.
Click to expand...
Click to collapse
for you the reason it runs cooler at 800Mhz is c-states runs the cpu with constant high power(battery killer C0). which means the cores are stuck on c3 and the package stuck on c2 or c3.

Keeping oom_adj value of specific apps low permantly

Hi there,
My Messaging APP can hardly stay running in background, and this cause me receive those important messages late. After digging in some information, I found that changing the three oom values of the process can make LMK see this process as high priority and won't kill it easily. By the way, I also changed niceness. However, it seems that Android system will change those oom values itself after a particular duration, so my tweak can only take effect in a short time. Is there any way to lock oom values or reach the same result?
My script of changing oom values and niceness:
Code:
#!/system/bin/sh
X=$(pidof jp.naver.line.android)
echo "-17" > /proc/$X/oom_adj
echo "0" > /proc/$X/oom_score
echo "-1000" > /proc/$X/oom_score_adj
renice -n -20 $X

[MAGISK][MOD]--Pixel4a-CpuTweak--V2

Pixel4a-CpuTweak--V2​
Short story : I do from time to time some monitoring on my phones(Using Francokernel app). Watching cpu freq, battery amp, etc. Since Android12 on my Pixel4a i noticed the cpu was almost always high for no serious reason compared to Android11. So i made a little script that use magisk to run as root and on boot to change some kernel parameters to make cpu way more batery friendly. It just let the little cores goes as low as they can and use the big cores for heavy task.
If you noticed a bad Screen On Time since Android12 then this module is for you.
This magisk module will make your cpu consume less power.
-Little cores can now go down to their lowest frequency
-Big cores are used for heavy task
Download attached below​
Spoiler: CHANGELOG
Code:
--V2
-Fix some tunable being reset by system
-set them after boot complete
-fix some typo
Spoiler: CODE
Code:
[/CENTER]
#!/system/bin/sh
MODDIR=${0%/*}
# # # WAIT TILL BOOT IS COMPLETE # # #
while true; do BOOT=$(getprop sys.boot_completed); if [ "$BOOT" -eq "1" ]; then sleep 3; break; else sleep 9; fi; done
# # # KERNEL SCHED # # #
echo '0' > /proc/sys/kernel/sched_schedstats; chmod 0444 /proc/sys/kernel/sched_schedstats
echo '1' > /proc/sys/kernel/sched_tunable_scaling; chmod 0444 /proc/sys/kernel/sched_tunable_scaling
# # # SCHEDUTIL FREQ # # #
echo '1248000' > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq; chmod 0444 /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo '1555200' > /sys/devices/system/cpu/cpufreq/policy6/schedutil/hispeed_freq; chmod 0444 /sys/devices/system/cpu/cpufreq/policy6/schedutil/hispeed_freq
# # # SCHEDTUNE # # #
#general
echo '0' > /dev/stune/schedtune.boost; chmod 0444 /dev/stune/schedtune.boost
echo '0' > /dev/stune/schedtune.prefer_high_cap; chmod 0444 /dev/stune/schedtune.prefer_high_cap
echo '1' > /dev/stune/schedtune.prefer_idle; chmod 0444 /dev/stune/schedtune.prefer_idle
echo '0-7' > /dev/cpuset/cpus; chmod 0444 /dev/cpuset/cpus
#background
echo '0' > /dev/stune/background/schedtune.boost; chmod 0444 /dev/stune/background/schedtune.boost
echo '0' > /dev/stune/background/schedtune.prefer_high_cap; chmod 0444 /dev/stune/background/schedtune.prefer_high_cap
echo '1' > /dev/stune/background/schedtune.prefer_idle; chmod 0444 /dev/stune/background/schedtune.prefer_idle
echo '0-5,7' > /dev/cpuset/background/cpus; chmod 0444 /dev/cpuset/background/cpus
#foreground
echo '0' > /dev/stune/foreground/schedtune.boost; chmod 0444 /dev/stune/foreground/schedtune.boost
echo '0' > /dev/stune/foreground/schedtune.prefer_high_cap; chmod 0444 /dev/stune/foreground/schedtune.prefer_high_cap
echo '1' > /dev/stune/foreground/schedtune.prefer_idle; chmod 0444 /dev/stune/foreground/schedtune.prefer_idle
echo '0-5,7' > /dev/cpuset/foreground/cpus; chmod 0444 /dev/cpuset/foreground/cpus
#top-app
echo '0' > /dev/stune/top-app/schedtune.boost; chmod 0444 /dev/stune/top-app/schedtune.boost
echo '0' > /dev/stune/top-app/schedtune.prefer_high_cap; chmod 0444 /dev/stune/top-app/schedtune.prefer_high_cap
echo '1' > /dev/stune/top-app/schedtune.prefer_idle; chmod 0444 /dev/stune/top-app/schedtune.prefer_idle
echo '0-5,7' > /dev/cpuset/top-app/cpus; chmod 0444 /dev/cpuset/top-app/cpus
#camera-daemon
echo '0' > /dev/stune/camera-daemon/schedtune.boost; chmod 0444 /dev/stune/camera-daemon/schedtune.boost
echo '0' > /dev/stune/camera-daemon/schedtune.prefer_high_cap; chmod 0444 /dev/stune/camera-daemon/schedtune.prefer_high_cap
echo '1' > /dev/stune/camera-daemon/schedtune.prefer_idle; chmod 0444 /dev/stune/camera-daemon/schedtune.prefer_idle
echo '0-5,7' > /dev/cpuset/camera-daemon/cpus; chmod 0444 /dev/cpuset/camera-daemon/cpus
#nnapi-hal
echo '0' > /dev/stune/nnapi-hal/schedtune.boost; chmod 0444 /dev/stune/nnapi-hal/schedtune.boost
echo '0' > /dev/stune/nnapi-hal/schedtune.prefer_high_cap; chmod 0444 /dev/stune/nnapi-hal/schedtune.prefer_high_cap
echo '1' > /dev/stune/nnapi-hal/schedtune.prefer_idle; chmod 0444 /dev/stune/nnapi-hal/schedtune.prefer_idle
#rt
echo '0' > /dev/stune/rt/schedtune.boost; chmod 0444 /dev/stune/rt/schedtune.boost
echo '0' > /dev/stune/rt/schedtune.prefer_high_cap; chmod 0444 /dev/stune/rt/schedtune.prefer_high_cap
echo '1' > /dev/stune/rt/schedtune.prefer_idle; chmod 0444 /dev/stune/rt/schedtune.prefer_idle
#restricted
echo '0-2,5' > /dev/cpuset/restricted/cpus; chmod 0444 /dev/cpuset/restricted/cpus
#system background
echo '0-2,5' > /dev/cpuset/system-background/cpus; chmod 0444 /dev/cpuset/system-background/cpus
I cannot speak for battery life but my phone feels significantly less responsive after installing the mod. Otherwise great idea, just doesn't work for my workflow.
Tom 23 said:
I cannot speak for battery life but my phone feels significantly less responsive after installing the mod. Otherwise great idea, just doesn't work for my workflow.
Click to expand...
Click to collapse
Thanks for the feedback. I've updated the module if you wanna try again. There was some typo that could make the phone less responsive. Now it will work as intended.
Dead-neM said:
Short story : I do from time to time some monitoring on my phones(Using Francokernel app). Watching cpu freq, battery amp, etc. Since Android12 on my Pixel4a i noticed the cpu was almost always high for no serious reason compared to Android11. So i made a little script that use magisk to run as root and on boot to change some kernel parameters to make cpu way more batery friendly. It just let the little cores goes as low as they can and use the big cores for heavy task.[/SIZE]
...snip...
Click to expand...
Click to collapse
COuld it be thyat by checking your phones current CPU useage, you are actually using ypour phone, and so the governor is ramping up your CPU clock to ensure the phone is reacting or ready to react? Have you compared your changes to switching to the conservative governor? (I am guessing this gov is available on the phone).
DiamondJohn said:
COuld it be thyat by checking your phones current CPU useage, you are actually using ypour phone, and so the governor is ramping up your CPU clock to ensure the phone is reacting or ready to react? Have you compared your changes to switching to the conservative governor? (I am guessing this gov is available on the phone).
Click to expand...
Click to collapse
There's no conservative governor in stock kernel. Schedutil is good and many little component rely on it (at least on stock rom)
Yes checking your cpu usage use cpu but you see how much and its so little that it doesn't ramp up cpu.
Android like Linux have the "top" terminal cmd which display the current process in use. More or less like task manager windows have.
Dead-neM said:
There's no conservative governor in stock kernel. Schedutil is good and many little component rely on it (at least on stock rom)
Yes checking your cpu usage use cpu but you see how much and its so little that it doesn't ramp up cpu.
Android like Linux have the "top" terminal cmd which display the current process in use. More or less like task manager windows have.
Click to expand...
Click to collapse
You are right, there is no "Conservative" gov. its not called "Conservative" but there is one called "Powersave"; which is the conservative gov, just named differently to what has been on my previous devices.
I took a moment to have a play, and set all the CPU's to the powersave gov, and found (surprisingly) if I set the smaller govs to powersave, then I notice big lags. Especially in the "tripple-tap-to-zoom" and then dragging about was completely unuseable. Leaving the small CPU's on schedutil and the big ones on powersave, I cant really say I noticed the lag. .But, since I dont have battery problems (i use an aggressive doze profile, and keep running apps under control, ie out of top -n 1;), I switched back to the standard gov.
One other little surprise is that I switched my IO scheduler to "noop" and although it *may* of possibly felt a tiny bit little more responsive, testing long running scripts, heavy in IO, actually ran slower.
Long story short, the powersave gov on the smaller cpu's induces lag. I did not check if the gov on the bugger CPU's saves much power.

Categories

Resources