yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M4 Aqua] ivy.lally:
Please, also take into account, switching cores itself costs energy too. And this is why it is better to have e.g. two cores always ready, think the two is optimal number as just two cores are busy the most often.

Aqua E2303, MM modded

---------- Post added at 02:54 PM ---------- Previous post was at 02:51 PM ----------

And just trying it again, and what can see the maximal freq 1113MHz, as hard set, is often reached.

Even if I have set now the max freq 1612 MHz it is sometimes reached, so there's no cap.

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
i notice that normal scrolling is still smooth even if i only allow one cpu to run, so i think switching on the another cpu is wasteful unless there are some other tasks (like opening apps)

---------- Post added at 11:48 PM ---------- Previous post was at 11:19 PM ----------

@AndyPhoenix9879 i'm going to follow this guide https://xdaforums.com/showthread.php?t=2769899 so i need some info about the cpu voltages that you set in SkyMelon9. is it possible that you share that info with us?
[Sony Xperia M4 Aqua] kurtkrky:
doesnt connect the pc

I flashed the lastest version of kernel. But my xperia doesn't connect the computer. I need help. Sorry my for bad english :)
[Sony Xperia M4 Aqua] HRSE:
a photo is worth a thousand words
[Sony Xperia M4 Aqua] ivy.lally:
It seems you're trying to understand the meanings of the particular tunable variables of interactive governor. Please share your knowledge of you manage because I move randomly in this area in the "trial and error" fashion. ;)

It is still much to improve in these parameters, in the configuration I've shared few posts before LITTLE cores still come online too soon and at all the next core switches on too soon before the previous one satiate the max frequency.

Aqua E2303, MM modded, SkyMelon

---------- Post added at 07:32 PM ---------- Previous post was at 06:52 PM ----------

Probably you're right taking Asmp max cpus online = 4,

It prevents switching online the LITTLE cores.

And then it is good to broaden frequencies scope, just now trying

max freq = 1344 MHz,

min freq = 100 MHz or 40 MHz,

and seeing promising results.

As said, most efficient frequency for silicon as such is about 1GHz, but switching cores on and off costs energy too. And this is why for Asmp the max freq should be somewhat higher than 1GHz: it saves switching online a next core too soon (It's better for a previous core to go over 1GHz before).

It improves performance as well.

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] Thedalamsyh:
tbh I've given up with asmp lol. sometimes I have issues with it. if I wake my device when it sleeps with 2 cores on, it lags as hell and doesn't respond to any touch input, and other cores doesn't seem to turn on, so I have to leave it still for like 4-5 mins for the phone to turn on work smooth again.

like you guys said, turning cores on and off requires power itself. so now I'm only using 5 cores, 4 lil cores and 1 big core for burst computing. I'm happy with the result, as I feel no more heating (temp stays 43-55°c under normal usage rather than 53-60++ with previous asmp settings), I got about 140 idle current while screen on, goes to sleep well, and it stays responsive whenever I need.

oh and I set minimal freq back to 200mhz and limit max freq to 998mhz with tuned interactive governor.
[Sony Xperia M4 Aqua] ivy.lally:
And maybe in your scenario it is good to set the first big core's

max freq = min freq = 40 MHz,

If shutting it down is impossible.

In this way it is possible to take full advantage of LITTLE cores efficiency

Allowing for higher frequency for cluster's just one core is highly inefficient because of separate cache.

Although, as I can see, the first lonely core is almost unused, it sticks always to the min freq, even when set

min freq = 40 MHz and

max freq = 1113 MHz

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] ivy.lally:
And now testing your configuration, what I can see the efficiency and performance are very similar between yours and mine configurations.

Probably it's because maintaining even one core in cluster switched on renderers the additional cache switched on either, so in your configuration you have two caches online always, what spoils LITTLE cluster's efficiency effect.

And yet about lagging, you can avoid lags in Asmp by setting min cpus online = 2

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] AndyPhoenix9879:
I have no idea how to read off the voltage off of it, but I do know that changing them had an effect. Go to my github source : https://github.com/AndyPhoenix9879/SkyMelon-msm8939/tree/26/arch/arm/boot/dts/qcom

.. and check for msm8939-regulator.dtsi & msm8939.dtsi (for this, look at speed2-bin, those values should give you an idea on the voltage step)
[Sony Xperia M4 Aqua] HRSE:
i do not see the lower frequencies (40MHz, 55MHz, 68MHz, 79MHz, 100Mhz) in the speed-bin mapping tables, can you explain a bit about them?

I have plotted the big CPU frequencies vs voltage level based on qcom,cpr-corner-frequency-map in msm8939-regulator.dtsi, assuming the low frequencies (40MHz, 69MHz, 100MHz) use the minimum voltage level (1)

for battery saving, i suggest to set the governor so that the big CPU spends more time at 200MHz, 346MHz, 800MHz and 1.34GHz. personally i will set min freq to 200 and max freq to 1.34GHz

[IMG="big CPU"]http://imghost.ucoz.org/upload20/201706221613011221.png[/IMG]

at the same frequency, the little CPUs use higher power levels than the big CPUs so i will turn them off for power saving (autosmp max_cpus=4) <<< need more studying about LITTLE CPUs
[Sony Xperia M4 Aqua] HRSE:
Attached is my current config for SkyMelon 9. I gathered info (informal: copied) from others users then adjusted a bit to suit my preference. I don't have any good method to evaluate it, but i believe my config is not for gamers.

Give it a try if you are free (back up your config first)

(Credits to: so many people who contributed to this thread)

Edit: fix error with above_highspeed_delay and autoSMP thresholds
[Sony Xperia M4 Aqua] ivy.lally:
You have done much work, thank you so much for tiding up the code, now it is easier to experiment and to discuss! :)

And what to do with these files, are they to use by some specific system's interface or just to run them by hand?

Aqua E2303, MM modded, SkyMelon

---------- Post added 23-06-2017 at 12:42 AM ---------- Previous post was 22-06-2017 at 11:55 PM ----------

And please accept some suggestions:

- interactive governor tunable

write /sys/devices/system/cpu/$1/cpufreq/interactive/above_hispeed_delay "30000 345600:20000 800000:20000 1113600:10000 10000"

doesn't sets up, nor by the sh executable nor in KernelAuditor,

- ...

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
thanks for pointing out, it actually couldn't apply/run because i wrote it wrongly!

I have updated the zip file above, and use your autoSMP thresholds (98/99), thanks!

I have an AutoMagic flow to keep monitoring the config files, when the file is modified then the flow will run the sh command. I use this to quickly change the config (experimental config)

There is another flow to execute the script on startup but it execute a different config file (stable config).
[Sony Xperia M4 Aqua] ivy.lally:
...

- you have set Asmp parameter

write /sys/kernel/autosmp/conf/cpufreq_up 100

and it prevents turning on other big cores, prevailing time there is just one core online rendering some lags you try to compensate with big GPU frequencies.

It's enough to set 99 instead of 100 to revive other cores.

- putting stringent policy to CPU and compensating it with higher GPU seems wasteful, GPU is reported as power hungry and hard to control its energy appetite. It is much better to swap burden to CPU from GPU.

- ...

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
[MENTION=7837559]ivy.lally[/MENTION] thanks for pointing that out! I have changed autoSMP thresholds to your settings and the cores are "tamed" now!

I do not limit GPU much because I want the CPU to be the only 'bottleneck' so that I can tune the CPU parameters, if there is any lag or slowdown then i know for sure that the fault is in the CPU settings.

Yesterday I had terrible lags while playing with the Google doodle until I lifted the GPU limit.
[Sony Xperia M4 Aqua] AndyPhoenix9879:
That's a beautiful plot. Actually I have no idea for the lower frequencies lol...
[Sony Xperia M4 Aqua] ivy.lally:
And just I wanted you to set this

/sys/kernel/autosmp/conf/cpufreq_up 99

As far as

write /sys/kernel/autosmp/conf/cpufreq_down 98

is concerned I have mixed feelings, its high value needed for switching off cores soon, so as

write /sys/kernel/autosmp/conf/cycle_down 1

as well, but maybe it its somewhat wrong: cores maybe should wait a little bit if they are needed again before switching them off. In fact, switching cores costs energy too so it needs limiting.

Aqua E2303, MM modded, SkyMelon

---------- Post added at 02:24 AM ---------- Previous post was at 02:14 AM ----------

Please, could you explain what foundation backs these settings (It seems you have understood its philosophy):

gpu:

/sys/module/adreno_idler/parameters/adreno_idler_idleworkload 5000

adreno_idler_idlewait 50

adreno_idler_downdifferential 50

cpus:

/sys/devices/system/cpu/$1/cpufreq/interactive/

above_hispeed_delay "30000 345600:20000 800000:20000 1113600:10000"

big:

target_loads

"80 345600:60 800000:40 1113600:85 1344000:88"

little:

target_loads

"80 800000:50 1113600:70"

and what about:

max_freq_hysteresis

?

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
[MENTION=7837559]ivy.lally[/MENTION] I'm just blindly exploring the settings, as i have no official documentation about these settings. If anyone has good sources, please share.

Recently, I have come across this very old thread https://xdaforums.com/showthread.php?t=2769899, so I give it a try. You can find the explanations in that thread.

However, there is no point to keep changing the settings without having a way to verify the effectiveness of the settings. How much battery is conserved? 10%? 20%? or just placebo effect?

Maybe we can gain some insight after reading this article Up close and personal: how the Samsung Galaxy S6 uses its octa-core processor

---------- Post added at 10:09 AM ---------- Previous post was at 09:57 AM ----------

Are we heading in the wrong direction when turning on autoSMP?

Another article about big.LITTLE performance and power saving https://community.arm.com/processors/b/blog/posts/ten-things-to-know-about-big-little

[MENTION=5689354]AndyPhoenix9879[/MENTION] maybe my understanding about little cpu's voltage level is totally wrong. Can you explain more about the speed bin for little CPUs?
[Sony Xperia M4 Aqua] ivy.lally:
Probably the text is about the most optimal frequency for the silicon material as such, frequency this is 1GHz and it is better to have e.g. 3 cores running at 1GHz at the moment than single core processor at 3GHz.

Asmp conforms to it well, question is if you want max_cpus value =4 or =8?

As we can see =4 suffices well but maybe is it better to set max freq to 1113MHz than to 1344MHz?

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
[MENTION=5689354]AndyPhoenix9879[/MENTION] what is the SuperSU version included in SkyMelon 9?

Is it possible to reinstall SuperSU ZIP in TWRP?

Just now I flashed SuperSU 2.82 and I had this error message :

Already patched, attempting to find stock backup
Stock restore failed, attempting ramdisk restore
Ramdisk restore failed, aborting

is this expected?
[Sony Xperia M4 Aqua] ivy.lally:
Please, take a look into this version, little corrected HRSE work, if somebody observes lags consider changing to Asmp's min_cpus=2 (in my feeling is ok if set =1)

http://cloud.tapatalk.com/s/594d1291f4236/AsmpI.sh.zip

It works quite well and is most battery friendly so far ;)

As so far both min_cpus =1 & =2 seem to have similar power consumption but =2 is better responsive.

And this:

echo 99 > /proc/sys/kernel/sched_upmigrate
echo 96 > /proc/sys/kernel/sched_downmigrate

controls how much processes want to migrate to a next cpu (or to return to previous). As we might want to utilize as much as possible the two first cores (without turning on next ones) thus both these values set as high as possible.

And contrary this:

write /sys/kernel/autosmp/conf/cpufreq_down 50 # 30
write /sys/kernel/autosmp/conf/cpufreq_up 99
write /sys/kernel/autosmp/conf/cycle_down 5
write /sys/kernel/autosmp/conf/cycle_up 5
write /sys/kernel/autosmp/conf/delay 200

ensures a next core is prevented from coming online as far as possible, but if already it is switched on then allow it to do its job and wait a little bit if any next job is loading (prevents excessive switching on/off cores which costs energy)

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
I have removed Xposed but the "optimising app" is still there.

Checking the boot log, I found 3 apps that I converted to system/integrated to system we're the cause. however, 5 other apps that I converted to system we're fine, so maybe there were some error while converting the 3 apps above to system.

I removed 2 of them, but the last one is tricky: Google Play Services → I can't uninstall it.

My (not fully tested) solution: delete file odex.system.sqsh and folder system.odex in recovery mode.

Now booting up is fast, no more"optimising apps" and my system partition has 400MB more of free space.

Also, seems like the annoying "NFC capacity full" error is gone also.sorry it is still there.

<<< THIS WILL CREATE ANOTHER SERIOUS PROBLEM (UNABLE TO BOOT AFTER WIPING CACHE)
[Sony Xperia M4 Aqua] valyo_bg:
Switching of cores is very nice, not so nervous like before. Even time to time stay only on first core at 100MHz. Let test UI for lags and how will be battery life.

---------- Post added at 16:23 ---------- Previous post was at 16:20 ----------

This is a strange, on every installing of Xposed I receive this message regarding optimizing of apps and after removing of Xposed this message disappear :confused: .

Removing of Google play services will kill your automatic backup and user information replication - contacts and etc. It's true that Google Play Services eat battery a lot, but there is no way (or I dont find way) to manage/decrease count of replications per hour ...
[Sony Xperia M4 Aqua] HRSE:
I have to admit that Google backup & sync services is very useful to me that I don't want to touch it, although sometime it has a lot of wakelocks.

With Xposed and Amplify, you can reduce the Google wakelocks.
[Sony Xperia M4 Aqua] valyo_bg:
Yes, but with Xposed my Bluetooth audio not work correct, so I can't use Xposed because of this.
[Sony Xperia M4 Aqua] HRSE:
sorry I forgot that you mentioned this before.

Does it mean all Bluetooth headset are dead after installing Xposed? I haven't tested this before, let me try...

Edit: music listening is still ok on Bluetooth, what is the problem that you have?
[Sony Xperia M4 Aqua] valyo_bg:
I just get my phone fully unresponsive, even can't unlock it - so slow working. Only way to overcome was to power off phone via volume-up and power button together. Before this now problems at all, phone work smooth. Maybe is a good idea to enable second cpu core - [MENTION=7837559]ivy.lally[/MENTION] could you add it in new zip file?

Edit: I just add second cpu manually inside script file, now one from big and one from small cores work all the time. Let see phone behaviour.
[Sony Xperia M4 Aqua] ragnalamb01:
Yes xposed ****s up bluetooth function even with smartwatch 2. Removing didnt work for me, had to flash a clean prerooted rom.

Enviado desde mi E2306 mediante Tapatalk
[Sony Xperia M4 Aqua] HRSE:
I'm using E2353 but I don't think that makes a big difference.

Are we using the same version of Xposed?

I'm using xposed-v87-sdk23-arm64.zip

With a cache wipe after installing
[Sony Xperia M4 Aqua] pawwaap:
Please, could you provide the full paths?

Any other side effects, what about performance and battery consumption?
[Sony Xperia M4 Aqua] HRSE:
it is in/system folder

please do a full backup first before any modification (including data partition).

Also, I copy that .sqsh file to SD card so that I can quickly copy back without the need of TWRP restore in case something went wrong (someone says I have to copy it in recovery mode)

I get the idea from this thread https://xdaforums.com/m4-aqua/general/resize-partitions-idea-t3487470

I have just deleted the file 2 hours ago, and rebooted 2 time after that, so far so good.
[Sony Xperia M4 Aqua] pawwaap:
Please, write the complete path :)
[Sony Xperia M4 Aqua] ragnalamb01:
I used xposed installer 3.1.1. It installed v87. I have no more info right now. I was using pexo rom 3.0 with 1.1 patch. And skymelon 9 on E2306.

Enviado desde mi E2306 mediante Tapatalk
[Sony Xperia M4 Aqua] HRSE:
sorry I have deleted the file and I don't remember exactly the path.

You can search for it in /system, file size is ~200MB

---------- Post added at 10:14 PM ---------- Previous post was at 10:12 PM ----------

I'm using stock ROM. This is a huge difference.
[Sony Xperia M4 Aqua] ragnalamb01:
So, the problem was pexo?? I liked because its deodexed and aesthetically enhaced. Well, guess Ill try xposed now that im on stock.

Enviado desde mi E2306 mediante Tapatalk
[Sony Xperia M4 Aqua] HRSE:
I can not confirm that the ROM is the cause of the problem, but if we were on different ROMs then it would be meaningless to compare other aspects.

We are off-topic for a while already, not sure if Andy and other guys will kick us out
[Sony Xperia M4 Aqua] ivy.lally:
It sometimes happens with min_cpus=2, it is important to have both cores in big cluster from the very beginning, otherwise both clusters are going to stay active without correcting it and powersave effect is spoiled.

Please run the file again, and again, until both cores activate in big cluster.

In order to allow for easier flopping active cores into big cluster while starting the file, I've putted these lines:

# Enable/disable cluster-plug (if use min_cpus=2 It may prevent activate a core in LITTLE cluster)
write /sys/module/cluster_plug/parameters/active 1;
sleep 3; # try different
write /sys/module/cluster_plug/parameters/active 0

# Asmp

and it sometimes works, but it needs improving.

http://cloud.tapatalk.com/s/594d2a29a1412/AsmpI2.sh.zip

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
I believe the kernel will decide which CPU to which on based on the governor setting of each cluster. For example if little cluster has less restriction to jump to high frequency then it will be turned on first rather than waiting till the conditions are met to turn on the big CPU.
[Sony Xperia M4 Aqua] Obblet:
Oh my god, thank you so much for this kernel! But I haven't tested it yet, because I have one small question. Can I use it with the build number 26.3.A.1.33?
[Sony Xperia M4 Aqua] HRSE:
Yes. In general it is for MarshMallow ROMs (6.x)
[Sony Xperia M4 Aqua] pawwaap:
I've 800MB free space in /system now but the message

"Android is starting...

starting apps"

with boot still appears (shortly but is)
[Sony Xperia M4 Aqua] HRSE:
you can check the boot log to see if there is anything suspicious.

Use keyword "odex" to find messages related to optimising apps.
[Sony Xperia M4 Aqua] valyo_bg:
This script work good, on first starting, both big cores are active :) .
[Sony Xperia M4 Aqua] HRSE:
With my messy config, the battery drops 16%/h for web surfing, is this normal?
[Sony Xperia M4 Aqua] valyo_bg:
No, my battery is ok. But I remove Kernel Adiutor and EX kernel, because found that if make some configuration, my battery goes down very quickly. I did several tests with same result. So without Kernel Adiutor even without any changes of SkyMelon 9 configuration, battery life is ok. Maybe someone can confirm this behaviour.
[Sony Xperia M4 Aqua] pawwaap:
And have you made dalvik and cache wipe after this?
[Sony Xperia M4 Aqua] ivy.lally:
Attempting twice the same and got the same result: after removing odex.system.sqsh file and odex.system directory and afterwards yet wiping Dalvik and cache the boot process is stuck on "waves" animation.

(I've restored system and data twice from backup.)

Have you encounter this too and why?

It would be nice to have additional space, many apps could be transferred to system.

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] ivy.lally:
If you want power efficiency most the little correction is needed in the GPU max freq:

### GPU
...
write /sys/class/kgsl/kgsl-3d0/max_gpuclk 285000000 #or 385000000

Previously written 220000000 in fact took no effect as there's no such slot. In turn the maximal frequency of GPU wasn't set and was default 700000000 i.e. overclocked, what spoiled much power efficiency effect.

As said before many times, graphical processor is power hungry and highly inefficient.

And this is why if you want phone just for reading internet (without any games) it is good to set GPU max freq as low as possible thus swapping burden to CPU which power efficiency we control.

http://cloud.tapatalk.com/s/594d8523ee6e5/AsmpI.sh.zip

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] Thedalamsyh:
exactly what I meant when I said my phone lags with asmp active lol. anyway how's it going now?
[Sony Xperia M4 Aqua] HRSE:
oh **** man! i didn't test this!

My apologies to [MENTION=7903587]pawwaap[/MENTION], [MENTION=7837559]ivy.lally[/MENTION] and whoever attempted my foolish method.

Also thanks for alerting everyone quickly.
[Sony Xperia M4 Aqua] ivy.lally:
It's ok, we're experimenting, and without risking how to achieve anything?

And is it anything to correct in your method to succeed?

Aqua E2303, MM modded, SkyMelon
[Sony Xperia M4 Aqua] HRSE:
I believe we can trim the sqsh file using the method describe here https://xdaforums.com/m4-aqua/general/resize-partitions-idea-t3487470

let's go there and discuss if needed

Edit: I followed the steps with my own list of files to remove, and wiped the cache before reboot. I could only save 300MB (this depends on the amount of system apps removed). The tricky part is to come up with 2 lists: 1 list of apks and 1 list of odexs, which must be matching, otherwise the apps won't run or the system won't boot pass animation screen.
[Sony Xperia M4 Aqua] AndyPhoenix9879:
2.78

If I remembered correctly, 2.82 had problems for Xperia devices.. :v

I'm not sure on the reinstalling SuperSU part :/ Maybe I should include a non-root version..
[Sony Xperia M4 Aqua] HRSE:
No need for now. I was trying to identify what caused the "Optimising apps", but I firgured out it was not SuperSU.

It is strange that my SuperSU app is 2.79-SR2 but it doesn't require to update SuperSU binary.
[Sony Xperia M4 Aqua] valyo_bg:
With 2 big cores enabled (using second version of script file provided by [MENTION=7837559]ivy.lally[/MENTION] ) there is no problem till now, phone work smooth, no lags and even I expect better battery life. Let test and will report.
[Sony Xperia M4 Aqua] HRSE:
[MENTION=5689354]AndyPhoenix9879[/MENTION] I encountered a hang followed by a reset.

This is the first time it happens, and I don't know what is the cause.

I see these few lines in the log:

[ 1585.650629] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[ 1585.650638] Modules linked in: wlan(C)
[ 1585.650661] CPU: 0 PID: 2889 Comm: android.ui Tainted: G WC 3.10.74-SkyMelon大龙-9- #1
...
[ 1585.651836] WARNING: at kernel/softirq.c:160 local_bh_enable_ip+0x48/0xa4()
[ 1585.651843] Modules linked in: wlan(C)
[ 1585.651861] CPU: 0 PID: 2889 Comm: android.ui Tainted: G D WC 3.10.74-SkyMelon大龙-9- #1
...
[ 1585.653905] Kernel BUG at ffffffc000090b60 [verbose debug info unavailable]
[ 1585.653913] Internal error: Oops - BUG: 0 [#2] PREEMPT SMP
[ 1585.653920] Modules linked in: wlan(C)
[ 1585.653934] CPU: 0 PID: 12134 Comm: mdss_fb0 Tainted: G D WC 3.10.74-SkyMelon大龙-9- #1
...
FXN Power-On Cause: 01100000 HWWD (ABNORMAL)
FXN Note: possibly HWWD
[Sony Xperia M4 Aqua] pawwaap:
And Dalvik too?