Power/performance kernel tuning and tweaks - Xiaomi Mi Max Guides, News, & Discussion

As suggested in LineageOS thread the discussion on kernel tweaks forks here.
Let's continue!
The recent post:
Zola III said:
Well you can use different profiles in Kernel Auditor but forgot anything turbo especially in GPU intensive games where you actually need to save on CPU power consumption but CPU frequency must stay high enough to allow full speed RAM operations (as that's the way it goes with Snapdragon boards) so that you have better headroom for GPU & less throttling by thermal engine. Think 500MHz is a best achievable sustained frequency & even that is achieved only when CPU power usage is tuned on stock MiUI & otherwise I can get GPU to get throttled down to 450MHz in less than a 30 min. A one GHz for a CPU is really golden middle regarding performance/power consumption no matter what lithographic processes is used to make it, it's simply tied to silicone as essential material.
Click to expand...
Click to collapse
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.1][HYDROGEN/HELIUM]LineageOS 14.1 r.03-27-2017 by*nijel8

This is my Init.d script I presently use, I've cumulated here your previous draft proposals and hints, please forgive me for its deficiencies and help to improve it:
Code:
#!/system/bin/sh
#
sleep 3;
################################# helper functions to allow Android init like script
function write() {
echo -n $2 > $1
}
function copy() {
cat $1 > $2
}
function get-set-forall() {
for f in $1 ; do
cat $f
write $f $2
done
}
################################
# Enable governor for LITTLE CPUs (perrf cluster):
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 40000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 96
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 1017600
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 1
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "80 400000:87 1017600:95 1190400:99"
#1305600
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 20000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 400000
# Enable governor for Big CUSs (power cluster):
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay 40000
###interactive/above_hispeed_delay 40000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 96
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 1017600
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy 1
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "87 400000:90 1017600:95 1382400:99"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 20000
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 400000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis 60000
# Configure core_ctl
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 0 0"
write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 90
write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 80
write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 1
write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 0 0 0"
write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 1
write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres 90
write /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres 80
write /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms 200
write /sys/devices/system/cpu/cpu4/core_ctl/task_thres 4
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
# set cpu_boost parameters
write /sys/module/cpu_boost/parameters/input_boost_freq "0:1190400 1:0 2:0 3:0 4:0 5:0 6:0 7:0"
write /sys/module/cpu_boost/parameters/input_boost_ms 200
write /proc/sys/kernel/sched_upmigrate_min_nice 15
# set (super) packing parameters
write /sys/devices/system/cpu/cpu0/sched_mostly_idle_freq 400000
write /sys/devices/system/cpu/cpu4/sched_mostly_idle_freq 400000
################################
# IO
echo 'deadline' > /sys/block/mmcblk0/queue/scheduler
# GPU
echo '133333333' > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq
echo '20' > /sys/module/adreno_idler/parameters/adreno_idler_downdifferential
echo 'Y' > /sys/module/adreno_idler/parameters/adreno_idler_active
echo '550000000' > /sys/class/kgsl/kgsl-3d0/max_gpuclk
echo 'simple_ondemand' > /sys/class/kgsl/kgsl-3d0/devfreq/governor
echo '20' > /sys/module/adreno_idler/parameters/adreno_idler_idlewait
################################
Please forgive me its imperfection, treat it as a draft. Please review it. Thank you very much!
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.1][HYDROGEN/HELIUM]LineageOS 14.1 r.03-27-2017 by*nijel8

Their isn't much to continue. Leaking is sustainable up to 1.4GHz (up to 1.6GHz on newer FinFET lithography). So the base & upper range that you don't want to go over for anything more than just burst start is pretty much same for all boards. I already described & wrote what should be done particularly for msm8956 & msm8976.
Script as it is so far; 2+2 core's
S652 octa core
Code:
#!/system/bin/sh
#
################################################################################
# helper functions to allow Android init like script
function write() {
echo -n $2 > $1
}
function copy() {
cat $1 > $2
}
function get-set-forall() {
for f in $1 ; do
cat $f
write $f $2
done
}
################################################################################
# Enable governor for LITTLE CPUs (perrf cluster)
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 40000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 90
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 1017600
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 1
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "87 400000:93 1017600:95 1190400:95"
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 20000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 400000
# Enable governor for Big CUSs (power cluster)
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay 40000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 93
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 998400
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy 1
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "87 400000:93 998400:95 1190400:95 1382400:97"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 20000
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 400000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis 60000
# Configure core_ctl
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms 200
write /sys/devices/system/cpu/cpu4/core_ctl/task_thres 4
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
# set cpu_boost parameters
write /sys/module/cpu_boost/parameters/input_boost_freq "0:1017600 1:0 2:0 3:0 4:0 5:0 6:0 7:0"
write /sys/module/cpu_boost/parameters/input_boost_ms 200
write /proc/sys/kernel/sched_upmigrate_min_nice 15
write /proc/sys/kernel/sched_upmigrate 87
# set (super) packing parameters
write /sys/devices/system/cpu/cpu0/sched_mostly_idle_freq 400000
write /sys/devices/system/cpu/cpu4/sched_mostly_idle_freq 400000
S650 hexa core
Code:
#!/system/bin/sh
#
################################################################################
# helper functions to allow Android init like script
function write() {
echo -n $2 > $1
}
function copy() {
cat $1 > $2
}
function get-set-forall() {
for f in $1 ; do
cat $f
write $f $2
done
}
################################################################################
# Enable governor for LITTLE CPUs (perrf cluster)
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 40000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 90
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 1017600
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 1
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "87 400000:93 1017600:95 1190400:95"
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 20000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 400000
# Enable governor for Big CUSs (power cluster)
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay 40000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 93
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 998400
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy 1
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "87 400000:93 998400:95 1190400:95 1382400:97"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 20000
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 400000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis 60000
# Configure core_ctl
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 1"
write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms 200
write /sys/devices/system/cpu/cpu4/core_ctl/task_thres 4
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
# set cpu_boost parameters
write /sys/module/cpu_boost/parameters/input_boost_freq "0:1017600 1:0 2:0 3:0 4:0 5:0 6:0 7:0"
write /sys/module/cpu_boost/parameters/input_boost_ms 200
write /proc/sys/kernel/sched_upmigrate_min_nice 15
write /proc/sys/kernel/sched_upmigrate 87
# set (super) packing parameters
write /sys/devices/system/cpu/cpu0/sched_mostly_idle_freq 400000
write /sys/devices/system/cpu/cpu4/sched_mostly_idle_freq 400000

You've written the frequency of one GHz is the most optimal because of silicon's physical properties, so this is very universal phenomenon (like e.g. resonance frequency) thus it applies to every silicon chip, is this right?

So I had some free time so I'm bringing back our TWRP flashable tweaks compatible only with ROM's that are based on nijel8 trees. You just have to flash it through TWRP. I also included addon.d script so tweaks will be kept after dirty flashing a ROM.
Which script you should pick?
It all depends on how you use the device. For some Zolla's will work better, for some mine will work better. Test it yourself(with and without core_ctl) and tell us how it goes.
Remember to pick zip for your device! Hydrogen is for Mi Max(2/16GB or 3/32GB) and Helium is for Mi Max Prime(3/64GB or 4/128GB). Don't mess it up or you might end into a bootloop.
Thanks to @Zola III for his tweaks.

@ioy
I don't really think you understand heuristics still.
1401600:99 & 1804800:99 are top frequencies per both clusters & it's a bit funny to try to manage their up scale load as their is no frequency behind it. You need a brick at big cluster at around 1.4GHz so find as I wrote earlier.
above_hispeed_delay "29000 1382400:39000" should be set to 40000 as the main scheduler tick rate is set to 20000 so every two ticks to decide to go over a GHz is perfectly enough. In many cases default scheduler tick rate is set to 40000 for maximum responsiveness that our eay sight can register I put it ti the 20000 rt clock ticks which is equivalent to a time needed for a blink of an eye. Anything in between isn't needed.
# note: Zola III proposed this to be applied to core 5 (cpu5)
Nope! It's understud it will be applied across the cluster & for msm8956 their is no need to apply anything more as their is only one more big core (cpu5) with shared L2 memory with cpu4. However on msm8976 (S652) it needs to be applied to cpu6 so that it is instructed specifically to use that core & keep it idle instead cpu5 as that way it has second L2 cache In use both cores keep exclusive not shared memory access to the L2 cache leading to bigger instruction output. & only with set min_cpus 2 for big cluster & not_preferred "1 0 1 0" instructing that it would be two core's permanently idling and that it should be a first one and third one in the cluster.
Same thing goes for a small cluster but this time around it's universal across both boards.
Edit at the end me by only putting min_cpus 2 & not_preferred "1 0 1 0" is all needed to be done without specific applying anything to cpu2 & cpu6 as core ctr is the one that controls which cores should be online and setup is applied for whole cluster anyway from a first core (cpu0, cpu4).
One more thing don't modify deadline;
echo '1473' > /sys/class/timed_output/vibrator/vtg_level
It's ridiculous & only hurts true output.
Find the script as I wrote on other form & try it.

@Zola III
Could you write here some setting for little cluster core_ctl? I want try it with setting of 2 little + 1 big and don't know with what's values should start on that busy up and busy down.

Anyone have the voltage tables for Hydrogen and Helium? I heard of the Kenzo sources for the SD650 having these tables, I couldn't find them though.
Don't laugh, I'm trying that initial Ghostpepper governor setup with forced steps to efficient frequencies and skipping less efficient ones. The latest version seems to have a more gradual stepping through all frequencies instead of the quick and hard jumps of the initial version.

Jerry08 said:
Did you test your settings? Im using different rom than nijel8, so no not_prefered setting. I test it myself and with this I have no lag. 1382mhz is not used by big cluster for me so 1190mhz is right. And that lovely smoothness and 4900 score on multicolore on Geekbench makes me stay there. Oh and the 99 on 1401600 is leftover from firsts setups. Dunno why I didn't remove it since I removed from 1804mhz.
Edit: Damn didn't see that @ioy, thought it was about my setup.
Another thing is that there is no difference in battery between 400mhz and 691mhz on little cluster so I recommend setting 691mhz.
Click to expand...
Click to collapse
Currently I don't test anything as my max is still locked but in the past I did very much work about it & some of it you can find hire:
https://forum.xda-developers.com/galaxy-s3-neo/orig-development/kernel-n1kernel-t3208957
Well 1.4GHz top is also applied & to your settings, 1.2GHz if you want to save a little more going above it is absurd.
Well even 400 & 691MHz are on the same VVD 691 will still use considerable more power but it will also have less reason to jump up on smaller loads so it's easier to contain. Problem appears more if min is set to 400MHz but not good contained there so that it jumps more frequently to the 691 & in that case it actually do spend considerable more power even than its set to min 691. & I do know that for a fact by experimenting. How ever I find 400 MHz min as more reasonable to save some juice & contain it not to bump over without real need after all we have hi speed load tunable there to make a fast bridge jump over in case of any real significant workload. It's not how 691MHz isn't reasonable if you want to go for more performance orientated setup (it will still use approximately 2x power than set to 400) but it also brings the other part of the problem & that would be how 1GHz & 691MHz are relatively close together so hi speed load should also be adjusted in this case more towards 1.2GHz. I don't intend to push performance metrics so I will remain at the balanced approach (400 min, 1GHz hispeed_freq) as an optimal.
Edit:
By the way 85 for an calculated load for a scaling up frequency or hi speed load is way to aggressive with IO is busy signaling enabled, without it its ok so bump it up a bit.

Zola III said:
Currently I don't test anything as my max is still locked but in the past I did very much work about it & some of it you can find hire:
https://forum.xda-developers.com/galaxy-s3-neo/orig-development/kernel-n1kernel-t3208957
Well 1.4GHz top is also applied & to your settings, 1.2GHz if you want to save a little more going above it is absurd.
Well even 400 & 691MHz are on the same VVD 691 will still use considerable more power but it will also have less reason to jump up on smaller loads so it's easier to contain. Problem appears more if min is set to 400MHz but not good contained there so that it jumps more frequently to the 691 & in that case it actually do spend considerable more power even than its set to min 691. & I do know that for a fact by experimenting. How ever I find 400 MHz min as more reasonable to save some juice & contain it not to bump over without real need after all we have hi speed load tunable there to make a fast bridge jump over in case of any real significant workload. It's not how 691MHz isn't reasonable if you want to go for more performance orientated setup (it will still use approximately 2x power than set to 400) but it also brings the other part of the problem & that would be how 1GHz & 691MHz are relatively close together so hi speed load should also be adjusted in this case more towards 1.2GHz. I don't intend to push performance metrics so I will remain at the balanced approach (400 min, 1GHz hispeed_freq) as an optimal.
Click to expand...
Click to collapse
Well setting of 400mhz as min was making too much jumping to 691mhz just like u said so I keep 691 so it sits there for long time. I will try higher setting of high frequency next battery cycle.

Jerry08 said:
@Zola III
Could you write here some setting for little cluster core_ctl? I want try it with setting of 2 little + 1 big and don't know with what's values should start on that busy up and busy down.
Click to expand...
Click to collapse
OK I will. Tell me which SoC do you have?

Zola III said:
OK I will. Tell me which SoC do you have?
Click to expand...
Click to collapse
652 helium.

Jerry08 said:
Well setting of 400mhz as min was making too much jumping to 691mhz just like u said so I keep 691 so it sits there for long time. I will try higher setting of high frequency next battery cycle.
Click to expand...
Click to collapse
No wonder that it jumps with calculated scaling up frequently set to 85 with IO is busy signaling enabled...
---------- Post added at 08:20 PM ---------- Previous post was at 08:03 PM ----------
Jerry08 said:
652 helium.
Click to expand...
Click to collapse
OK try like this for two little & one big;
# Configure core_ctl
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 0 0 0"
write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 1
write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms 200
write /sys/devices/system/cpu/cpu4/core_ctl/task_thres 4
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
This would be for a two + two combo & only on Helium (S652):
# Configure core_ctl
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms 200
write /sys/devices/system/cpu/cpu4/core_ctl/task_thres 4
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
Two + two should be most suitable deal performance wise especially regarding inter core (& cross cluster regarding it) communication very important for thread migration between clusters.
Best regards.

Zola III said:
No wonder that it jumps with calculated scaling up frequently set to 85 with IO is busy signaling enabled...
---------- Post added at 08:20 PM ---------- Previous post was at 08:03 PM ----------
OK try like this for two little & one big;
# Configure core_ctl
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 0 0 0"
write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 1
write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms 200
write /sys/devices/system/cpu/cpu4/core_ctl/task_thres 4
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
This would be for a two + two combo & only on Helium (S652):
# Configure core_ctl
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu0/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu0/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu4/core_ctl/min_cpus 2
write /sys/devices/system/cpu/cpu4/core_ctl/max_cpus 4
write /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres 78
write /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres 55
write /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms 200
write /sys/devices/system/cpu/cpu4/core_ctl/task_thres 4
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
Two + two should be most suitable deal performance wise especially regarding inter core (& cross cluster regarding it) communication very important for thread migration between clusters.
Best regards.
Click to expand...
Click to collapse
Okay I'm a test it tomorrow when I discharge battery. And that not_prefered doesn't work for me cause I'm using AICP and not nijel8's LOS and as I remember right nijel8 fixed something in core_ctl to make it work.

Jerry08 said:
Okay I'm a test it tomorrow when I discharge battery. And that not_prefered doesn't work for me cause I'm using AICP and not nijel8's LOS and as I remember right nijel8 fixed something in core_ctl to make it work.
Click to expand...
Click to collapse
Don't really know about it on AICP, what is & how implemented. Core ctrl is developed originally by Motorola and CAF for CAF obviously (read the CAF as the AOSP) fany part is all for max is based upon Lineage including AOSP alike ROM's. The not_preferred is actually used to mark which core's should be those kept active idling. If not_preferred works as it should please do & post (full) results for PCmark works 2.0 test
If it's not a to big problem for you regarding both 2+1 & 2+2 setup. Thanks in advance.

Zola III said:
Don't really know about it on AICP, what is & how implemented. Core ctrl is developed originally by Motorola and CAF for CAF obviously (read the CAF as the AOSP) fany part is all for max is based upon Lineage including AOSP alike ROM's. The not_preferred is actually used to mark which core's should be those kept active idling. If not_preferred works as it should please do & post (full) results for PCmark works 2.0 test
If it's not a to big problem for you regarding both 2+1 & 2+2 setup. Thanks in advance.
Click to expand...
Click to collapse
I'm sure that not preferred parameters doesn't work for me cause its using Strix los kernel. And yes I'll test both setups just give me few days as I'm testing new setups with at least 1 full battery cycle or more if I don't find it lagging or stuttering.

Zola III said:
@ioy
I don't really think you understand heuristics still.
1401600:99 & 1804800:99 are top frequencies per both clusters & it's a bit funny to try to manage their up scale load as their is no frequency behind it. You need a brick at big cluster at around 1.4GHz so find as I wrote earlier.
Click to expand...
Click to collapse
And what about this:
Code:
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "80 400000:87 1017600:95 1190400:99"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "87 400000:90 1017600:95 1382400:99"
BTW what does the first number after "target_loads" mean?
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.1][HYDROGEN/HELIUM]LineageOS 14.1 r.03-27-2017 by*nijel8

ioy said:
And what about this:
Code:
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "80 400000:87 1017600:95 1190400:99"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "87 400000:90 1017600:95 1382400:99"
HELIUM, LOCKED bootloader, [ROM][UNOFFICIAL][7.1.1][HYDROGEN/HELIUM]LineageOS 14.1 r.03-27-2017 by*nijel8
Click to expand...
Click to collapse
Actuality try like this:
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "87 400000:90 1017600:93 1190400:95"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "87 400000:90 1017600:93 1382400:95"
99 is bit to much & this is also with IO is busy idling enabled considered in.

Why's 99 too much? I have visibly better Ampere readings with this (while reading the forum through TapaTalk).
What does the first number after "target_loads" mean?
About busy idling, do you mean this:
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 1
is this right?

@Zola III
Well I decided to set up little cluster core_ctl today and it seems that it needs that not_prefered setting as after I set up 2+1(or 2+2 later) I ran into network problems. It was stopping network for few seconds every minute. So sorry but I won't be able to test it.

Related

favorite/best SIMPLE compcache and linux-swap scripts?

I've been playing a little bit with Compcache and Linux-swap on the latest Cyanogen ROMs, but it seems like there are so many variations of these scripts out there that I don't know 100% that the performance I'm seeing is because of the swap method used (compcache, compcache with backing swap or pure Linux-swap) or the particularities of the script. I'd like to set up some Gscripts with the SIMPLEST Compcache, Compcache with backing swap and pure Linux-swap scripts so that I can reboot with no userinit.sh, run a Gscript and see how the phone performs and get an idea of how they each perform with various settings (size and swappiness).
You'll notice that this is NOT posted in the development section, so feel free to explain to me what any scripts you want to share do or don't do. I'm sure others will benefit as well.
Thanks!
not one? (here's what I'm playing with now)
Ok, here is what I am playing with now:
(Generl stuff/mods, mostly commented out.)
Code:
#!/system/bin/sh
uname_r=`uname -r`
moddir=`find /system/modules -type d -name $uname_r`
insmod=/system/bin/insmod
$insmod $moddir/compcache/xvmalloc.ko;
$insmod $moddir/compcache/ramzswap.ko #disksize_kb=32000;
#$insmod $moddir/compcache/ramzswap.ko backing_swap=/dev/block/mmcblk0p3 memlimit_kb=32000;
mknod /dev/ramzswap0 b 253 0;
echo 20 > /proc/sys/vm/swappiness;
#echo 1 > /proc/sys/vm/page-cluster; # default: 3 Changes Page clustering from 8 to 2.
#echo 5 > /proc/sys/vm/laptop_mode; # default: 0 Helps keep SSD from getting worn.
#echo 5000 > /proc/sys/vm/dirty_expire_centisecs; # default: 3000
#echo 800 > /proc/sys/vm/dirty_writeback_centisecs; # default: 500
#echo 10 > /proc/sys/vm/dirty_background_ratio; # default: 5
#echo 16 > /proc/sys/vm/dirty_ratio; # default: 10
echo 2000000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
swapon /dev/ramzswap0;
#swapon /dev/block/mmcblk0p3;
#echo 200 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias;
#echo 128000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
#echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
Note: I believe these are correct for recent CM builds with a Linux-swap partition. If you are using anything else, do some research first.
Did you get any testing done on this?
Am interested as well.
(+ If you' re at it test a swap files instead of a swap partition as well, it shouldn't make any difference, see http://forum.xda-developers.com/showthread.php?p=4136554#post4136554)
I played with a variety of different setting with decent results
I wouldn't say that I "tested" any specific settings combinations exactly, but like many I found that Linux-swap set to a relatively low swappiness (20-30) gave me better results than compcache, but that was before switching to the latest Cyanogen ROMs with the tweaked kernel to better use compcache (SWAP_FREE_NOTIFY patch) AND compcache enabled by default. Since then I've mostly been using the ROMs without any userinit because the performance is so good already.
I keep meaning to find a copy of the settings used by miketaylor00 because he seems to think they're quite good (when someone says swappiness 28 works much better than swappiness 30, it makes me think he's tested pretty extensively ), but laziness or apathy has stymied my attempts thus far.
**EDIT**
nm, found infoz already.

[resolved] Revisiting egl.cfg

Update: Resolved to my satisfaction: http://forum.xda-developers.com/showpost.php?p=14323192&postcount=8
The egl.cfg we've been using:
Code:
1 1 android
0 1 POWERVR_SGX530_121
is functionally equivalent to removing the software renderer:
Code:
0 1 POWERVR_SGX530_121
Original post:
......................................................................................
So, we've been running /system/lib/egl/egl.cfg set as:
Code:
1 1 android
0 1 POWERVR_SGX530_121
This tweaked egl.cfg essentially disables hardware rendering and substitutes software rendering. The default setting is
Code:
0 0 android
0 1 POWERVR_SGX530_121
We do this because this was reported to be much, much faster by just about everyone and I will admit to also experiencing this improvement. However, I've recently run 2.1 and honestly it really puts our 2.2 to shame. Additionally it's never made any sense that the software renderer would outperform hardware acceleration. It makes more sense that there's something wrong with our graphics libraries and that's why software rendering wins. Or we were mistaken in believing things were faster.
In my work-in-progress ROM, I've updated graphics libraries (for other reasons) and then I tried disabling the tweak and performance seems much improved and much closer to what I see in 2.1 (FYI, for some reason I had to wipe dalvik-cache after making the change or boot got stuck, but that could be unrelated).
So, the question is: are the updated graphics libraries the reason it works or was changing egl.cfg a mistake?
Can some adventurous souls try going back to the defaults and report whether they really think the software render really is faster? Please post which ROM you are testing on. If switching egl.cfg back to defaults makes things worse, we can then try whether updating the graphics libraries to the versions I'm testing helps.
RusMod,usyng egl.cfg as soft renderer.
In next version i will try to move egl.cfg to default from 2.1 and will ask people - how it feeling.
For results will post here.
btw, afaik defy uses same video accel?
p.s. http://xt720.fjfalcon.ru/Mods/rusmodv1.14.zip
RusMod users haven't noticed much problem(all usyng fastboot kernel)
But in quadrant when going test with2 planets - scores shows like in 2.1.
I wondered how long it would take for this to come back up. I think that the difference between hardware and software based encoding on our phone is more of a question of "What else is being affected?"
Obviously, there isn't too dramatic of a difference in the overall performance or people would have been screaming about it way back when we made this change. I am more concerned about the possibility of other things, such as battery life or video performance being affected by these settings. Is it possible that other things are being hit? Who knows. I always knew that this change was merely cosmetic, a way to boost quadrant scores.
Mioze7Ae, I switched mine back and have been tinkering with it since. I have not noticed a significant difference. It actually seemed a bit choppier. If you have a test build with new libs, I would be willing to try it out for a while and see if I can break it.
I forgot to add:
I'm running galaxyXTv4. I didn't like the way epicsteelblue looked.
reverendkjr said:
Mioze7Ae, I switched mine back and have been tinkering with it since. I have not noticed a significant difference. It actually seemed a bit choppier. If you have a test build with new libs, I would be willing to try it out for a while and see if I can break it.
Click to expand...
Click to collapse
I also notice it is slightly choppier sometimes but on the other hand the software rendering to me feels sluggish and the hardware rendering feels more responsive. For example scrolling: open something with a long list and throw the list up and down. The software rendering seems to slow this down and lag a bit, but the hardware rendered flows faster and seems to stay underneath my finger. The 3D program list in ADW Launcher is noticeably faster and smoother.
Anyway, as you wish here's the work-in-progress.
http://www.multiupload.com/HYUZG4E3BZ
It's a larger rework of Dexter's 1.3. It's based on an analysis I'm doing where I compare which files change and which files remain identical between Motorola's XT720 2.1, Motoroi 2.1 and 2.2, and Milestone 2.1 and 2.2 releases in order to make predictions about which versions of these files should be on Milestone XT720 2.2. It's a full ROM that applies as an update instead of a nandroid image. I switched the 2nd-init hijack to the simpler bin/sh_hijack.sh+etc/rootfs one that is used on Milestone instead of the mot_boot_mode+lw+lw2+ramdisk.tar method. Not included are the init.d scripts--so the governors, overclocking, ext partition, swap, moving dalvik-cache to /cache are "do it yourself" for now. I'm porting the CM6 scripts to implement that, but they're not ready.
How is the battery life doing Mioze7Ae? And thanks for fixing, will try this weekend when im free. =)
khankuan said:
How is the battery life doing Mioze7Ae? And thanks for fixing, will try this weekend when im free. =)
Click to expand...
Click to collapse
Honestly, I haven't had that ROM running long enough to have an opinion about its battery life. It's quickly evolving and I keep flashing back to an earlier version that's about half-way between bugfix-3 and this version for my everyday use. There's still a lot I need to do with this ROM before I'm ready to "move in" and dogfood it. Anyway it's my feeling that disabling the egl.cfg tweek improves performance on this ROM.
In the mean time, if changing the egl.cfg back actually makes things worse on current ROMs, we can see about testing just these specific libraries in those ROMs. There's just so many of them. I'll see if I can make a library patch for galaxyXTv4 for reverendkjr to test.
Which one do you run?
Hi been useing the rus.mod and it has without error something could not say before very good build.
Sent from my XT720 using XDA Premium App
I think I've figured this out
Ok, here's the scoop: contrary to what I thought, xav's hacked egl.cfg actually disables the software renderer all together. In testing with Quadrant Advance I get identical (best) performance from either of these two egl.cfg's:
Code:
1 1 android
0 1 POWERVR_SGX530_121
and (my recommendation):
Code:
0 1 POWERVR_SGX530_121
More info
The documentation header for egl.cfg says:
Code:
#
# One line per configuration, of the form:
#
# D I TAG
#
# D: display (0: default)
# I: implementation (0: software, 1: hardware)
# TAG: a unique tag
#
# The library name loaded by EGL is constructed as (in that order):
#
# /system/lib/egl/libGLES_$TAG.so
# /system/lib/egl/lib{EGL|GLESv1_CM|GLESv2}_$TAG.so
#
Now, what had me confused in the past is I couldn't make heads or tails of what "D: display (0: default)" means. Somehow when re-reading that today had the obvious revelation that it's referring to "display number" and 0 is the display number of the primary screen (the default screen) the same way that X11 in Unix refers to displays. So:
Code:
1 1 android
means "use the android software renderer as a hardware renderer on the second display" (we don't have a second display and I don't think it can mean the TV or HDMI out, either because Motorola never defined any renderers for a second device). In fact, you can just delete or comment out the entire 0 0 android line and get the same results.
From testing, a tale-tale sign of the software renderer being used is that messed up moon. Hardware rendering doesn't have the messed up moon.
Motorola's default enables both:
Code:
0 0 android
0 1 POWERVR_SGX530_121
It turns out that even making the software renderer available is bad for 3D performance.
So why does having the software renderer around cause trouble? Speculation: I thought OpenGL is supposed to figure out the best way to render things, so why is it getting this wrong? My guess is the software renderer must provide APIs that are preferred compared to what the hardware interface provides so applications or the GL library negotiates to use the software API rather than a less desirable hardware-accelerated library or perhaps they can't tell the difference. Or perhaps Quadrant is a piece of junk. That's my guess anyway.
Here's a bunch of testing I did (default kernel frequencies/voltages):
Code:
egl.cfg: 0 0 android
0 1 POWERVR_SGX530_121
# Has the messed up moon
Tot CPU Mem I/O 2D 3D
------+----+---+---+---+----
1: 573 954 813 630 194 273
2: 590 989 841 648 195 276
3: 627 1029 981 654 195 277
4: 597 1008 842 663 195 275
5: 601 1025 847 662 194 277
egl.cfg: 1 1 android
0 1 POWERVR_SGX530_121
# No messed up moon
Tot CPU Mem I/O 2D 3D
------+----+---+---+---+----
1: 612 925 820 601 194 521
2: 590 935 842 459 195 519
3: 654 949 977 626 196 524
4: 642 1009 822 656 195 527
5: 643 998 854 645 194 524
egl.cfg: 0 1 android
0 0 POWERVR_SGX530_121
# Noticably awful--feels like a Macintosh 512k
# Quadrant warns about using software rendering
# Has the messed up moon
Tot CPU Mem I/O 2D 3D
------+----+---+---+---+----
1: 465 803 730 562 79 151
2: 477 735 784 635 80 152
3: 487 773 791 638 80 153
4: 472 750 757 622 80 153
5: 468 785 773 552 80 152
egl.cfg: 0 0 POWERVR_SGX530_121
# No messed up moon
Tot CPU Mem I/O 2D 3D
------+----+---+---+---+----
1: 613 860 860 626 193 524
2: 635 963 836 658 194 522
3: 641 1014 807 661 196 526
4: 654 989 912 653 194 522
5: 674 1026 977 648 194 525
egl.cfg: 0 1 POWERVR_SGX530_121
# No messed up moon
Tot CPU Mem I/O 2D 3D
------+----+---+---+---+----
1: 609 919 960 452 193 519
2: 601 946 716 620 195 528
3: 664 999 960 647 195 521
4: 627 1014 751 651 194 527
5: 642 1008 820 661 192 529
egl.cfg: 0 1 POWERVR_SGX530_121
0 0 android
# Has the messed up moon
Tot CPU Mem I/O 2D 3D
------+----+---+---+---+----
1: 575 917 872 626 189 269
2: 595 967 890 651 193 273
3: 597 978 901 634 194 277
4: 577 1006 845 571 192 272
5: 591 982 834 665 195 278
I flashed dexter's 1.3, then I installed your update. I'll run it for a while and get back to you on my results. A couple of items though. First, the camera apk doesnt work. I tried deleting and reinstalling, but it will not. Also, Milestone Overclock refuses to load. I am wondering if you have experienced anything along these lines yet.
reverendkjr said:
I flashed dexter's 1.3, then I installed your update. I'll run it for a while and get back to you on my results. A couple of items though. First, the camera apk doesnt work. I tried deleting and reinstalling, but it will not. Also, Milestone Overclock refuses to load. I am wondering if you have experienced anything along these lines yet.
Click to expand...
Click to collapse
Yeah, none of that works yet. It's probably not worth playing with extensively yet. I've only just started getting into the libraries. When it's closer to usable I'll post another.
I changed my egl to
0 1 POWERVR_SGX530_121
completely removed the android line. I was surprised to see that was even possible. I also managed to get the Milestone Overclock v. 1.4.1 to run on this and OC to 1ghz. I was thinking about trying
1 1 android
0 0 POWERVR_SGX530_121
since it doesn't look like that was tried yet. I'll do that later. I have been running the all day and do believe there is a level of "snappiness" that the other versions do not have.
reverendkjr said:
I changed my egl to
0 1 POWERVR_SGX530_121
completely removed the android line. I was surprised to see that was even possible. I also managed to get the Milestone Overclock v. 1.4.1 to run on this and OC to 1ghz. I was thinking about trying
1 1 android
0 0 POWERVR_SGX530_121
since it doesn't look like that was tried yet. I'll do that later. I have been running the all day and do believe there is a level of "snappiness" that the other versions do not have.
Click to expand...
Click to collapse
Not much of a difference. I went back to
0 1 POWERVR_SGX530_121.

[RESULTS] Overclocking with UrukDroid

$aur0n said:
It would be good to start another topic for overclocking (with values that works, perhaps scores) - anyone willing to gather this data?
With this it will be easier for people to setup their values...
Click to expand...
Click to collapse
Please post your results by using overclocking under UrukDroid here. For benchmark results please use Quadrant Standard Edition. You can download it for free on Android Market. And don't forget to say if you think your configuration is stable.
A70it
Board Version: A70S-V6
Uruk:
1.6RC4
settings:
max_vsel=65
max_rate=1100000
I think the results may be different because the fabrication of the CPU's is also a reason.
stable: yes
tested: browsing, games like Angry Birds, Dungeon Hunter....
Quadrant Score: 1706-1460
UrukDroid:
1.6RC4
settings:
max_vsel=60
max_rate=1100000
stable:yes
tested apps : games (angry birds , NFS , air attack , dragon fly , racingmoto ) , browsing , music , videos
quadrant Score:1581-1162
Uruk:
1.6RC4
settings:
max_vsel=60
max_rate=1050000
stable:yes
tested apps : games (My Country)
A101IT
Board Version: A101IT-V6
Uruk:
1.6RC4
settings:
max_vsel=60
max_rate=1050000
stable:yes
tested apps: games (angry birds, flick soccer, homerun battle, 3d bowling, basketball shoot)
quadrant score: 1465
i always fail to overclock. whats the forum thread to a successful overclock on archos gen8. i use setcpu it only remains on 1000, urukdroid 1.6rc4
thx
You first need to configure the kernel module, as SetCpu is only there for switching the maximum down from what the tables are saying.
@All:
Please also state Model ( A101,A70S,A70H,A43,A28) and if possible boardversion.
rc4
archos 70 it
I use text editor to change the values to 65 and 1100000 but the editor won't let me save the changes
You need one that has Root when editing.
fzelle said:
You need one that has Root when editing.
Click to expand...
Click to collapse
Yes, one like Root Explorer
A70it
Board Version: A70S-V6
Uruk:
1.6RC4
settings:
max_vsel=67
max_rate=1100000
stable: yes or almost (see below)
tested: browsing, games like Angry Birds, YouTube, Market....
Quadrant Score: not tested
Remarks: [email protected] did not seem stable: FC's, strange behaviour. So I bumped the volts a notch. This seems stable, but not yet entirely sure. It may need just a bit more, 68, 69 or even 70...
For understanding more, I did the calc how much volts the different vsels really yield (based on $auron's formula )
vsel
60 = 1,35V (default for 1Ghz)
65 = 1,4125V
67 = 1,4375V
70 = 1,475V
---------- Post added at 11:41 AM ---------- Previous post was at 11:40 AM ----------
rapunzel11 said:
Yes, one like Root Explorer
Click to expand...
Click to collapse
Well I have some strange issues with that too. Before updating to RC4 it would always be ok to use FileExpert in root mode to edit the file. But now, that leads to error when saving, ie no rights.
I have to go into FileManager or what the other thing is called (also root capable), rename the cpugovernor to cpugovernor.txt, edit it, then I can save. Then rename it, (re)start CPUGovernor: then the settings DO take succesfully.
Archos 70it.
I have tried 1.6rc4 both with 1.6b1 kernelocuv and with 1.6rc4 at 60& 1100000.
Both were stable and fast. I may prefer the first one.
Are there any advantages- disadvantages to either of them?
arie_i said:
Archos 70it.
I have tried 1.6rc4 both with 1.6b1 kernelocuv and with 1.6rc4 at 60& 1100000.
Both were stable and fast. I may prefer the first one.
Are there any advantages- disadvantages to either of them?
Click to expand...
Click to collapse
Well yes - second on is better You can do ALL what was done in OCUV (just rewrite cpu table) in RC5+ - but you may disable it with few clicks and test configuration that suits you best.
ps. I've added link to this thread in manual for overclocking.
ps2. Free "root capable" file explorer is FileExpert (default file manager since UrukDroid 1.5) - you just need to enable this feature in it's configuration menu.
@$aur0n
I have installed UrukDroid 1.6.4 and wanted to overclock the Archos 101 with the help of you manual.
My current cpugovernor stats output:
Code:
Uruk-CPUGovernor statistics:
Current governor: interactive
Overclock module: Enabled
Current max vsel: 66
Current max rate: 1000000
CPU Max: 1000000
CPU Min: 300000
Available frequencies: 1000000 800000 600000 300000
CPU statistics (tick spend in every frequency range):
1 GHz had 17458 ticks (8.18%)
800 MHz had 20275 ticks (9.50%)
600 MHz had 31112 ticks (14.58%)
300 MHz had 144634 ticks (67.75%)
Then I try to manualy set the vsel and rate with:
Code:
echo 66 > /proc/overclock/max_vsel
echo 1000000 > /proc/overclock/max_rate
and whatever numbers I set, the Archos reboots instantly. I even tried setting max_rate to 900000 and it also rebooted!?
What am I doing wrong?
Thanks
Edit:
I did the rest in your manual and set the right memory addresses... damn, I thought these are automatically set - it seems they could be. Now lets try to set the real max
Edit2:
OC = 1.1Ghz ; Max_vsel=68 == Enough for me.
I have just installed Urukdroid 1.6 on my Gen8 A101T.
Sorry to be a bit thick, but how to I know test how much it can be overclocked?

[A6020] Kernel Tweaks [03/31/2017]

Kernel Tweaks Intended for balanced performance/battery life on actual usage.
Please provide feedback.
Changelog/FAQs
Attention! It assumes that you've already optimized your phone (background apps, idle drain, wakelocks...), which is up to you, and NOT covered on this post.
All sources and credits at the end.
Great thanks to @Dreamstar for the awesome Vegito Kernel!
NOT recommended for gaming, image processing or heavy loads.
Tweaks:
CPU
I/O scheduler
GPU
HMP scheduler (big.Little related)
Virtual Memory
perfd, sched_boost and sched_load disabled to use LITTLE as the main cluster in order to save power
Minimal overheat
Any ROM/Kernel:
http://www6.zippyshare.com/v/PGToHEyx/file.html
does NOT affect hotplug at all, may seem sluggish with incorrect profiles (due to lack of optimization)
does not apply Input Boost
disables Touch Boost (if present)
Kernels with Core Control (core_ctl) hotplug enabled (Lineage OS, AOKP, RR):
Option 1:
http://www103.zippyshare.com/v/WQlpK3en/file.html
Great SoT/Battery Life
May feel sluggish
May contain micro lag/stuttering
2 Little cores always online
big cluster offline most of the time
may have problems with audio crackling during music playback
Option 2:
http://www103.zippyshare.com/v/tz4IiM4n/file.html
Biased towards performance (in case the previous one was behaving bad)
Slightly less battery life
Smooth enough
Little cluster always online
big cluster offline most of the time
Vegito Kernel (RECOMMENDED):
http://www76.zippyshare.com/v/lSXeYI9b/file.html
New*: http://www19.zippyshare.com/v/n9CsRYYk/file.html
*if unstable (e.g. force close), set swappiness to a value between 10~60
Best balance between performance/battery
Snappy
Smooth
Above-average SoT
Thunderplug support
big.LITTLE always online (lower latency and no waste of CPU cycles)
Input boost set at 998Mhz on Little cluster, with duration of 1980ms. (not very battery friendly, try lower values)
Useful links:
The truth about kernels and battery life
Your battery gauge is lying to you (and it's not such a bad thing)
Diving into Doze Mode
Battery Calibration (myth)
Battery Drain Benchmarks
Sources/Credits:
Original GlassFish settings for interactive by @soniCron
Interactive governor battery save scripts by @Sickaxis79
Xiaomi Mi Max Kernel Guide by white778899
LSpeed by @Paget96
[AKT] Advanced Kernel Tweaks by @Asiier, @patalao, @Mostafa Wael and @Senthil360
Changelog 03/31:
Code:
Cleanup:
- Fixed useless loops and condition checks
- Added credits (developers of Project Zhana/Advanced Kernel Tweaks)
- Typos
Vegito only (unstable):
CPU:
- Timer slack cut in half (from 480000) on big Cluster
- Increased 'go_hispeed_load' (91 -> 400 on big, 91 -> 155 on LITTLE)
- Input Boost duration reduced to 120ms (from 1920ms); (drastically improves battery)
- Input Boost frequency increased to 1113MHz (from 998MHz); should not affect battery much, since it stays on the same voltage
GPU
- Revert 'underclock' (465MHz -> 550MHz) to minimize UI lags, trust Adreno Idler to reduce power consumption.
HMP Scheduler:
- Lower 'sched_upmigrate' (90 -> 85)
- 'sched_freq_dec_notify' decreased (410000 -> 400000)
Virtual Memory:
- Increased ZRam to 256MB (from 128MB)
Changelog 03/30:
Code:
HMP Scheduler:
- don't schedule background tasks on big cluster
Virtual Memory - reduce usage of CPU cycles:
- new values from Project X.A.N.A (high dirty_ratio and dirty_background_ratio, min_free at 4M and default vfs_cache_pressure)
IO Scheduler:
- New logic to apply I/O scheduler (from Project X.A.N.A)
- Try ZEN
- if zen is not available use noop (on Lineage OS), otherwise use BFQ.
- increased read-ahead to 512Kb (core_ctl scripts still use 128Kb)
- apply to internal and external memory (SDCard) if present
- changed zen tunables (thanks to [URL=https://forum.xda-developers.com/oneplus-3/how-to/advanced-interactive-governor-tweaks-t3476589][AKT] Advanced Kernel Tweaks[/URL] by [user=6187429]@Asiier[/user] - Project X.A.N.A
Cleanup:
- moved verbose descriptions (now at the end of this post)
- Mhz -> MHz
core_ctl only:
CPU:
- target load set to 499Mhz until 75% (from 70%)
Virtual Memory:
- 20 swappiness and 70 vfs_cache_pressure
- page-cluster set to 0 (read only 1 page from swap each attempt)
- Laptop Mode set to 1
Vegito only (unstable):
HMP Scheduler:
- try to use big cluster more, easing the load of the the LITTLE cluster (from [URL=https://forum.xda-developers.com/showpost.php?p=69417941&postcount=724]Project X.A.N.A[/URL]) (*trying different freq_notify values atm)
- big.LITTLE should not overload a single core or cluster.
CPU:
- align_windows set to 0 (both clusters)
- increased min_sample_time (from 0)
- revert 'fix erratic jump to 998Mhz while idle'
Virtual Memory:
- swap only to avoid out of memory conditions ( vm.swappiness = 0 ) # if unstable (e.g. force close), set to a value between 10~60
- lower ZRam (200MB -> 128MB)
- Laptop Mode disabled
Changelog 03/29:
Code:
Cleanup:
- add simple function to change permissions and apply settings
- typos
Vegito only:
CPU
- fix erratic jump to 998Mhz while idle
--------------------------
FAQs
How to apply (need root):
Apply every boot.
Using Terminal (RECOMMENDED):
Code:
su -c 'sh /script directory/script.sh'
or
su
cd 'script directory/'
sh script.sh
Can be found at Developer Options or you can download one from the Play Store: https://play.google.com/store/apps/details?id=com.termux
Using Kernel Adiutor:
Copy file to /etc/init.d/
Give permissions rwxr-xr-x (0755)
Go to init.d tab on Kernel Adiutor
Execute script.sh
Why do you leave all cores online??11 (vegito)
CertifiedBlyndGuy said:
Thought I would add more to this and make it useful for a few users.
The reason behind why Mpdecision is disabled by default is due to the fact that it is highly inefficient in the sense that hotplugging on Linux, put simply, sucks. Why? The hotplug acts as a front-end to the scheduler to provide a means of plugging and unplugging cores in exchange for a high amount of latency. This means that even though a core may be plugged, there is a delay of several milliseconds before this is actually processed causing microstutters that are hard to notice, but do disrupt performance. The same can be said for the thermal driver and how it Aries frequencies.
Click to expand...
Click to collapse
franciscofranco said:
Leaving all cores online is fine, they'll hit retention and power collapse pretty quickly if nothing is running on them. There's a lot of work when offlining and onlining cores.
Click to expand...
Click to collapse
franciscofranco said:
Hotplug is the action of onlining a core (after it has been unplugged) in a live system, which is present in any Kernel of any device with more than 1 core. You can offline it through sysfs. What you are asking is: if there's any automatic mechanism that onlines & offlines cpu cores based on some special heuristic. The answer is no.
They are online at all times unless there's the need for some thermal throttle. They'll follow the standard Linux resume->suspend mechanism just like any other "normal" phone when the OEM doesn't **** with the natural cycle. This is exactly how the Nexus 6P (same chip) works. I explain it in the changelog & in the feature list. Cores will go to idle in a "jiffy" if they don't have any runnable threads running.
Click to expand...
Click to collapse
From: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/index.html
Code:
15.1.3. Retention
The core state, including the debug settings, is preserved in low-power structures,
enabling the core to be at least partially turned off. Changing from low-power
retention to running operation does not require a reset of the core. The saved
core state is restored on changing from low-power retention state to running
operation. From an operating system point of view, there is no difference between
a retention state and standby state, other than method of entry, latency and use-related constraints.
Check if you Kernel supports the Core Control (core_ctl) hotplug driver:
These folders must be present:
Code:
/sys/devices/system/cpu/cpu0/core_ctl/
/sys/devices/system/cpu/cpu4/core_ctl/
Extreme Kernel (cluster-plug based -> version 12/30 and above)
Try GlassFishCP or FairyTale from https://forum.xda-developers.com/moto-x-play/general/interactive-governor-battery-save-t3443201
Disable Alucard hotplug (to prevent conflicts with cluster-plug)
Disable Simple GPU Algorithm and enable Adreno Idler (Why)
My battery's still crap:
Check if settings were applied correctly.
Try lower input_boost_ms value (at cost of snappiness, can introduce stutter while scrolling)
Check for wakelocks using BetterBatteryStats
Disable Keep Awake/Wi-Fi scan for Google Play Services (unknown side effects):
Settings -> Privacy -> Privacy Guard -> Advanced (dropdown) -> Google Play Services -> Keep Awake/Wi-Fi-Scan
Disable Keep Awake for apps that refuse to sleep, like Facebook and other battery hoggers.
Greenify
General Battery Tips
Disable location when not using
Remove extra widgets from the desktop
Disable live wallpapers
Settings -> Wi-Fi -> Configure -> Keep Wi-Fi on during sleep - Only when plugged in
Settings -> Wi-Fi -> Configure -> uncheck - "Network notification"
Disable unnecessary sync
Disable automatic updates and notifications for updates on Google Play.
Disable push and notification of social networks.
Do not use Task-killers
Do not use programs and widgets to monitor daily usage of the smartphone.
If the quality of the LTE network connection is poor, switch the "Network Type" to 3G or 2G
Source: https://4pda.ru/forum/index.php?showtopic=707426
Obvious:
Use lower brightness (try to keep it below 30%)
Prefer Wi-Fi networks and disable data connections when not using.
Settings explained:
Code:
Android Documentation
https://android.googlesource.com/kernel/common/+/android-4.4-n-release/Documentation/
Kernel - Virtual Memory
https://www.kernel.org/doc/Documentation/sysctl/vm.txt
Performance Testing with SSDs Pt. 2 by Toby Chappell Systems
https://devs.mailchimp.com/blog/performance-testing-with-ssds-pt-2/
How is Heterogeneous Multi-Processing (HMP) scheduling implemented in Linux Kernel (Samsung Exynos5422)?
http://stackoverflow.com/questions/25498215/how-is-heterogeneous-multi-processing-hmp-scheduling-implemented-in-linux-kern
Scheduler Documentation (from DTS Eagle Integration into [Code Aurora Forum] Android (kernel))
https://github.com/dtsinc/DTS-Eagle-Integration_CAF-Android-kernel/blob/master/Documentation/scheduler/sched-hmp.txt
# Read-ahead cache
# Typically, larger values increase sequential read speed and slightly reduce the random read speed. The larger the cache, the less growth
and the more compromises.
# Setting rq_affinity to 2 tells the kernel that the specific CPU core that requested the I/O must be the one that completes it.
# add_random with a setting of 0 avoids the overheard of I/O events contributing to the entropy pool in /dev/random.
# Standard I/O elevator operations include attempts to merge contiguous I/Os. For known random I/O loads these attempts will always fail
and result in extra cycles being spent in the kernel. This allows one to turn off this behavior on one of two ways: When set to 1,
complex merge checks are disabled, but the simple one-shot merges with the previous I/O request are enabled. When set to 2, all merge
tries are disabled. The default value is 0 - which enables all types of merge tries.
# https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block
# Laptop mode is used to minimize the time that the hard disk needs to be spun up,
# to conserve battery power. It has been reported to cause significant power savings.
# When the knob is set, any physical disk I/O (that might
# have caused the hard disk to spin up) causes Linux to flush all dirty blocks. The
# result of this is that after a disk has spun down, it will not be spun up
# anymore to write dirty blocks, because those blocks had already been written
# immediately after the most recent read operation. The value of the laptop_mode
# knob determines the time between the occurrence of disk I/O and when the flush
# is triggered.
# A task whose nice value is greater than this tunable value will never be considered as a "big" task (it will not be allowed to run
on a high-performance CPU).
# android background processes are set to nice 10. Never schedule these on the big cluster.
# echo 9 > /proc/sys/kernel/sched_upmigrate_min_nice # 15 default, 9 to never schedule background tasks on big Cluster, and 7
on Project Zhana
Known bugs:
Kernel Adiutor seems to change minimum number of big cores to 2 on Core Control. Avoid checking 'Hotplug' tab when using scripts with core_ctl support (try Kernel Adiutor-Mod if problem persists).
Thanks for credits
What auto run booting???
cenelyanto said:
What auto run booting???
Click to expand...
Click to collapse
Copy file to /etc/init.d and set the right permissions (see FAQ).
Keep in mind these scripts are deprecated.
booting noot run otomatic step by step for on ...otomatis run booting

Basic Tuning for Hardrock kernel (Noob freindly Guide)

ok , I am writing this guide to help those users who are not able to configure kernel tweaks themselves...(Just summarized way).Depend upon preferences, users need to adjust settings.I am not going in details but just what everyone need to adjust for battery, performance or balanced profiles.
All these settings is for Hardrock kernels so dont ask for other kernel related settings.
First of all to adjust settings you need Kernel auditor or similar tools. You can download from playstore
Lets get started(I am taking into consideration Hardrock kernel governors, io schedulers , gpu settings etc):
** one more thing is even If I am sharing, the experience or thoughts might be different from person to person.so I am just providing some initial ideas for tweaks
1) For Battery related settings (sorted from best) :
select anyone of these cpu governors:
a) ZZmove (add from cpu tunables profile no 2)
b) smartmax EPS
c) ondemand
d) conservative/powersave
cpu clock frequency :
set cpu frequency min 480 mhz and max 2.4 ghz
set gpu governor to ondemand
I/o scheduler : Noop
2) For Extreme Battery realted settings :
a) ZZMOVE (Profile no 3)
b) smartmax eps
set cpu frequency min 480 mhz and max 2.2 ghz
set gpu governor to ondemand
I/o scheduler : zen
3) For balanced profile settings :
a) InteractiveX
b) Interactive pro
b) Intelliactive
c) Impulse
d) cultivation
min cpu frequency 480 and max 2.4 ghz
I/o scheduler : maple or zen
4) For performance settings:
a) InteractiveX
b) Performance
c) Hyper
d) blue active
set min freq 650 mhz and max 2.8 ghz
set I/O scheduler to Fiops or BFQ
5) For gaming settings :
a) InteractiveX
b) Performance
c) Ironactive
d) Intelliactive
e) on demand
set min freq 650 mhz and max 2.8 ghz
set Gpu min frequency 100 and max 999 mhz and select adreno gz or ondemand
set I/O scheduler to Deadline
6) For completely insane beast settings
a) Performance
b) InteractiveX
c) Intelliactive
d) nightmare
min frequency 1036 mhz and max 2.8 ghz
set gpu min 100 and max 999 mhz and select adreno-gz or ondemand
set I/O scheduler to Fiops
7) For Multitasking settings
a) Interactive
b) interactive_pro
min frequency 650 mhz and max 2.8 ghz
Open governor tunables and change the following(if You can't find those settings then leave it):
* boostpulse_duration = 80000
* go_hispeed_load = 95
* hispeed_freq = 499200
* input_boost_freq = 960000
* min_sample_time = 100000
** target_loads = 98 422400:15 729600:30 1190400:35 1344000:40 1497600:55 1574400:60 1651200:65 1728000:75 1958400:85 2035200:90 2265600:95 2496000:98
set I/O scheduler to CFQ OR BFQ
Remember I am not focussing on gpu since if its idle then it wont drain, it will only pump up once you are into game.so select either ondemand or msm adreno gz gpu governor for any kind of settings..
For I/o schedulers, I/O Read Ahead Buffer is dependent on the size of your flash storage (internal/external). Below is the recommended settings for the given size that will yield the best performance .
Less than 8GB - 128KB
8GB - 512KB
16GB - 1024KB
32GB or above - 2048KB
please set this as read ahead for internal or external storage depending on volume size..
and please do not touch other kernel settings , just leave them as it is..
** and try to read more from google.It will be big help instead of asking again and again
Something like this was much needed, keep tweaking this as and when any changes made to the kernel in future..
awesome........simply awesome........ thank you
Xiaomi4X said:
Something like this was much needed, keep tweaking this as and when any changes made to the kernel in future..
Click to expand...
Click to collapse
Yeah will be posting or updating this thread once I am having something new to offer
Friend I don't know what I did , but your profile zip V3 worked
Hard_Rock83 said:
ok , I am writing this guide to help those users who are not able to configure kernel tweaks themselves...(Just summarized way).Depend upon preferences, users need to adjust settings.I am not going in details but just what everyone need to adjust for battery, performance or balanced profiles.
All these settings is for Hardrock kernels so dont ask for other kernel related settings.
First of all to adjust settings you need Kernel auditor or similar tools. You can download from playstore
Lets get started(I am taking into consideration Hardrock kernel governors, io schedulers , gpu settings etc):
** one more thing is even If I am sharing, the experience or thoughts might be different from person to person.so I am just providing some initial ideas for tweaks
1) For Battery related settings (sorted from best) :
select anyone of these cpu governors:
a) ZZmove (add from cpu tunables profile no 2)
b) smartmax EPS
c) ondemand
d) conservative/powersave
cpu clock frequency :
set cpu frequency min 480 mhz and max 2.4 ghz
set gpu governor to ondemand
I/o scheduler : Noop
2) For Extreme Battery realted settings :
a) ZZMOVE (Profile no 3)
b) smartmax eps
set cpu frequency min 480 mhz and max 2.2 ghz
set gpu governor to ondemand
I/o scheduler : zen
3) For balanced profile settings :
a) InteractiveX
b) Interactive pro
b) Intelliactive
c) Impulse
d) cultivation
min cpu frequency 480 and max 2.4 ghz
I/o scheduler : maple or zen
4) For performance settings:
a) InteractiveX
b) Performance
c) Hyper
d) blue active
set min freq 650 mhz and max 2.8 ghz
set I/O scheduler to Fiops or BFQ
5) For gaming settings :
a) InteractiveX
b) Performance
c) Ironactive
d) Intelliactive
e) on demand
set min freq 650 mhz and max 2.8 ghz
set Gpu min frequency 100 and max 999 mhz and select adreno gz or ondemand
set I/O scheduler to Deadline
6) For completely insane beast settings
a) Performance
b) InteractiveX
c) Intelliactive
d) nightmare
min frequency 1036 mhz and max 2.8 ghz
set gpu min 100 and max 999 mhz and select adreno-gz or ondemand
set I/O scheduler to Fiops
Remember I am not focussing on gpu since if its idle then it wont drain, it will only pump up once you are into game.so select either ondemand or msm adreno gz gpu governor for any kind of settings..
For I/o schedulers, I/O Read Ahead Buffer is dependent on the size of your flash storage (internal/external). Below is the recommended settings for the given size that will yield the best performance .
Less than 8GB - 128KB
8GB - 512KB
16GB - 1024KB
32GB or above - 2048KB
please set this as read ahead for internal or external storage depending on volume size..
and please do not touch other kernel settings , just leave them as it is..
** and try to read more from google.It will be big help instead of asking again and again
Click to expand...
Click to collapse
I was messing with my device , and I backed up my device with twrp recovery , and then installed China miui developer ROM just to see the difference in China and global ROM, when I returned to global ROM , by restoring the backup I made , I booted my device and just uninstalled the kernel adiutor ,
Then I tried to follow this guide and tried creating profile in kernel adiutor, when one profile I created is shown in the list.. I thought let's try flashing the zip of profiles by @Hard_Rock83
And falshed the V3 profile zip, and it worked all profiles are in the list removing mine..that I created
beingtejas said:
I was messing with my device , and I backed up my device with twrp recovery , and then installed China miui developer ROM just to see the difference in China and global ROM, when I returned to global ROM , by restoring the backup I made , I booted my device and just uninstalled the kernel adiutor ,
Then I tried to follow this guide and tried creating profile in kernel adiutor, when one profile I created is shown in the list.. I thought let's try flashing the zip of profiles by @Hard_Rock83
And falshed the V3 profile zip, and it worked all profiles are in the list removing mine..that I created
Click to expand...
Click to collapse
I just want to say lol:laugh:
I never trust miui..it behaves strange or weird always..
What is the difference of this one from the V3 profile?
fgaurano said:
What is the difference of this one from the V3 profile?
Click to expand...
Click to collapse
lol I am just guiding here, whoever having issues flashing profiles.. its all same...
Where can i find profile file?
As i using free version of kernel audiutor i need twrp flashable zip file.
Can anyone help me?
MiladHashMan said:
Where can i find profile file?
As i using free version of kernel audiutor i need twrp flashable zip file.
Can anyone help me?
Click to expand...
Click to collapse
Lol you need to open your eyes and find the profile v3 thread.. https://forum.xda-developers.com/mi-max-2/development/kernel-profiles-hardrock-kernel-v1-t3804630
Hi, thanks for your work, is there any guide on how to prevent aggressively killing of this kernel? After apllied this kernel on MIUI 10 v8.8.23, apps that's supposed to be running all the time like whatsapp, gsam, etc keep getting killed aggressively.
Nice..thanks for the info
Thanks Hard_Rock83.
Anybody knows how to port this over to Xiaomi Note 4/4x which has Snapdragon 625 as well?
Updated THread for multitasking..PLease check OP.
I've only just discovered this thread, thanks for putting all the information together!
Nice tips
Sent from my MI MAX 2 using Tapatalk

Categories

Resources