[Guide][Discussion] Advanced Interactive Governor Tweak/Config - Kirin 970 CPU

otonieru

Senior Member
May 7, 2011
3,440
2,207
243
Djakarta
As all we know, our phone has one of the newest & most powerful CPU in the market : Kirin 970

together with a huge 4000mAh battery, this phone theoritically should deliver an extremely good battery life. And from what i experienced, this phone perform quite admirably.
That being said, when being compared to other flagships in the market (as can be seen here : https://www.youtube.com/watch?v=lXp-4QyJpmo), Mate 10 still fall short to the like of Oneplus 5 which actually has a smaller battery,

biggest factor that might affect that result , aside from the screen resolution difference, is of course, software & kernel optimisation,

in an attempt to get a better battery life out of this device, but without impacting performance, i remember one of the guide made by @soniCron i used to stumbled upon few years ago. This Guide give a very detail insight on how to optimize the interactive governor on almost any device/any kernel/any rom (as long as you have root), and thats what i gonna try to apply to our device - if you want to check the guide yourself : HERE

so i take a look into Huawei Mate 10 Kernel Sources to see the voltage values being used by this processor for each frequency step. And here's the table :



from that table, we can see which frequencies are using most power, and where is the most jump in voltage usage happen when switching between frequency.
Higher voltage jump will cost more power, means less battery life.
in conclusion, i found few frequencies which are unfavorable, which is

A53 CPU
:
1210Mhz - because it use same power (850000µV) as 1402Mhz, so we better use 1402Mhz instead for better performance with same power cost
1556Mhz - same story, it use same power (950000µV) as 1690Mhz
and
1844Mhz - it use most power, but since this is the top freq, we can neglect it

A72CPU
:
1018&1210Mhz - use same power (780000µV) as 1364Mhz, so we better off jump directly to 1364Mhz
1498Mhz - same case, it use same amount of juice (900000µV) as 1863Mhz
and
2362Mhz - it use most power, but since this is the top freq, we can neglect it

_____________________________________________________________________________________________________________________________________________________

Now we take into account of the minimum frequency needed to ensure smooth task (if you dont know what am talking about, read the GUIDE i mention in my opening paragraph) :fingers-crossed:

For Mate 10, i've found the best frequency is as following :
  • Idle = 509MHz
  • Scrolling = 1018MHz (Use Chrome browser to scroll Facebook in desktop mode)
  • Video = 1402MHz (Play 1080p*60fps videos in Youtube app)
  • App load = 1690MHz (Use any app really)
  • High load = 1844MHz (Max out just in case)

Using the formula take from soniCron guide, i tried calculate optimum CPU load (this will be used as target load config) config for each frequencies

If you want to see the formulas :
Code:
We want to determine 2 values for every available clock rate: the maximal efficient load and the minimal efficient load. To make this determination, we need to bust out our calculators. (Or spreadsheets!)

For the maximal efficient load, we want to correlate a load value no higher than 90% of a given clock rate before it would be more efficient to jump to the next clock rate–to avoid overwhelming a particular rate while avoiding premature jumps to the next. For this value, we calculate it as:

    (clock rate * 0.9) / next highest clock rate

For example, the maximal efficient load for 600Mhz on the Nexus 5X would be caluclated as:

    (600000 * 0.9) / 672000 = 80.36% (rounded and normalized: 80)

For the minimal efficient load, we want to correlate a load value at which anything higher would be better served by a higher clock rate. To calculate this:

    (1 - next highest clock rate / clock rate) * -1

For example, the minimal efficient load for 600Mhz on the Nexus 5X would be calculated as:

    (1 - 672000 / 600000) * -1 = 12.00% (rounded and normalized: 12)
with this config, logically speaking we want to make the Governor to favour the "best" frequencies above, and minimize the usage of unfavourable freqs.

A53
Code:
509Mhz : 45
1018Mhz : 76
1210Mhz : 15
1402Mhz : 81
1556Mhz : 8
1690Mhz : 82
1844Mhz : 90

A72

Code:
682Mhz : 60
1018Mhz : 19
1210Mhz : 13
1364Mhz : 81
1498Mhz : 24
1652Mhz :12
1863Mhz : 80
2093Mhz : 12
2362Mhz : 90
Now that we already get the optimum number, time to apply it

Use your favorite Kernel Manager, in my case, am using Kernel Adiutor, and go to CPU Config - CPU Governor Tunables and input these value (am using Hawktail profile from soniCron thread, as it seems it work best for most of devices, and i already do trial & error with some other value like timer rate as well ) :

A53 (LITTLE)
Code:
go_hispeed_load: 99
above_hispeed_delay: 20000 509000:60000 1018000:25000
timer_rate: 28000
hispeed_freq: 509000
timer_slack: 80000
target_loads:  98 509000:45 1018000:76 1210000:15 1402000:81 1556000:9 1690000:82 1884000:90
min_sample_time: 30000
boost: 0
boostpulse_duration: 80000
A72 (BIG)
Code:
go_hispeed_load: 99
above_hispeed_delay: 20000
timer_rate: 20000
hispeed_freq: 1863000
timer_slack: 80000
target_loads:  98 682000:60 1018000:18 1210000:12 1364000:81 1498000:24 1652000:12 1863000:80 2093000:12
min_sample_time: 20000
boost: 0
boostpulse_duration: 80000
Now you can test it. Do full charge and use it normally, see whether you can see the improvement or not,
Hopefully it helps you as it seems to help me (you can expect no less than 7Hrs to 10 Hrs SoT, am quite heavy user myself, with 2 WhatsApp account and 1 LINE account constantly active. YouTube & Gaming at least hour/day as well). Discussion is more than welcome here, as these are considered an initial calculations that still yet to furtherly fine tuned for our CPU.
 
Last edited:

markvd90

Senior Member
Dec 25, 2008
183
21
18
Wierden
Used it and didnt notice any issues. Performance was perfect.
However, I just updated so I lost root.
Does anyone know if I can just root again without wiping stuff or not?
 

ytgbg

Senior Member
Jul 15, 2013
573
202
63
@otonieru
Isn't it Min Sample Rate value for Small Cores too extreme (30 000)?
On my Kirin960 I use Min Sample Rate valuse on Big and Small Cores at 90 000 and everything is still smooth, I am not gaming though. Huawei on Kirin960 uses Min Sample Rate at 80 000 stock...
Also I am turning on the Fast Ramp Down for Big Cores and Small Cores.
But my setting are more battery oriented and still I don't loose smoothness mate.
 

xpdragon

Senior Member
Feb 16, 2006
203
62
48
Tried the settings on my Mate 10. I see noticeable improvement on battery and performance. I haven't noticed any issue so far. Thanks for sharing.
 
  • Like
Reactions: otonieru

0rigin

Senior Member
Jan 1, 2013
504
216
73
Sh*topia
This thread is underrated, therefore bump.

Tweaked my CPU settings a few days ago, and the difference in battery life is very noticeable, without any obvious loss of performance or fluidity.

Not gonna talk about numbers, because every single user has a different usage scenario, but if you are interested, I recommend you to at least try it, there's nothing to lose.

I can't understand why biggest OEM's won't put a bigger emphasis on optimizations of the existing, rather than on user unfriendly "innovations".
 

otonieru

Senior Member
May 7, 2011
3,440
2,207
243
Djakarta
Are you talking about Hawktail from here? https://androidfilehost.com/?w=files&flid=96527
Hawktail, Hawktail1.1 or Hawktail1.2 ?
I can say, none of it.

The base is hawktail indeed, but a mix of all those three + an adaptation to suit our 970 cpu better

You can go to sonicron thread to read more about each specific governor parameter and the hawktail profile itself
 
  • Like
Reactions: badmania98

otonieru

Senior Member
May 7, 2011
3,440
2,207
243
Djakarta
@otonieru
Isn't it Min Sample Rate value for Small Cores too extreme (30 000)?
On my Kirin960 I use Min Sample Rate valuse on Big and Small Cores at 90 000 and everything is still smooth, I am not gaming though. Huawei on Kirin960 uses Min Sample Rate at 80 000 stock...
Also I am turning on the Fast Ramp Down for Big Cores and Small Cores.
But my setting are more battery oriented and still I don't loose smoothness mate.
Well, it could be, but maybe not as well, LoL

I didnt really set those number to be a really battery oriented, as this phone already have huge battery to begin with, so even small improvement can do bigger impact.

i tried bigger number, but found it stutter a bit (at least to my liking) so, those are numbers that serve me best.

But of course everyone can re-tweak it to their liking ;)
 

badmania98

Senior Member
Sep 23, 2007
704
341
93
Miticasburg/ROMANIA
I can say, none of it.

The base is hawktail indeed, but a mix of all those three + an adaptation to suit our 970 cpu better

You can go to sonicron thread to read more about each specific governor parameter and the hawktail profile itself
So, I have to download hawktail profile and modify it according to your values. Where do I copy the file and how I load it in Kernel Adiutor?

or

I have to modify the interactive governor with these values?
 
Last edited:

otonieru

Senior Member
May 7, 2011
3,440
2,207
243
Djakarta
So, I have to download hawktail profile and modify it according to your values. Where do I copy the file and how I load it in Kernel Adiutor?

or

I have to modify the interactive governor with these values?
No no no, no need to download anything

You can simply input the governor value in the kernel adiutor. You need donate version btw.
 
  • Like
Reactions: badmania98

Saadkhalid786

Senior Member
May 9, 2017
111
13
0
applied it and now charging the phone. however one doubt tho. im using kernel adiutor as a user app and applied these settings. will these settings stay even if EMUI closes the kernel adiutor? (not talking about reboot since after reboot the profile needs to be applied again(?))
already selected kernel adiutor to run in background btw.
 

otonieru

Senior Member
May 7, 2011
3,440
2,207
243
Djakarta
applied it and now charging the phone. however one doubt tho. im using kernel adiutor as a user app and applied these settings. will these settings stay even if EMUI closes the kernel adiutor? (not talking about reboot since after reboot the profile needs to be applied again(?))
already selected kernel adiutor to run in background btw.
It will stay until reboot even if you uninstall Kernel Adiutor. Just dont apply any setting that will affect CPU, like battery saver etc :)

It best to allow Kernel Adiutor to launch automatically, ignore batt optimisation and run in the background though.
 
  • Like
Reactions: Saadkhalid786

Saadkhalid786

Senior Member
May 9, 2017
111
13
0
It will stay until reboot even if you uninstall Kernel Adiutor. Just dont apply any setting that will affect CPU, like battery saver etc :)

It best to allow Kernel Adiutor to launch automatically, ignore batt optimisation and run in the background though.
thanks. can i just turn power saver on from battery setting and then apply these values? just curious.