[KERNEL TWEAK] Interactive Governor Paramaters [Rooted phone]

Kernel Mechanic

INTRODUCTION:

Interactive governor is a time based CPU scaling governor. It’s an Intelligent ondemand governor.
What’s the difference?
Ondemand is a simple load based CPU scaling governor. If an app prosecutes higher CPU loads then the ondemand governor would immediately instrcut CPU to run at max frequencies in order to overcome the load and jumps down to min frequency as the CPU load lowers. From the CPU frequency stats of Ondemand governor, it is noticed that the CPU uses Max/Min frequencies at the most while not utilizing the intermediate frequencies that are available for the phone. With this one might find the battery to be best during idling. But to be consuming more power during foreground usage. Accordingly the thermal aspects would also be highly varying.
Now this is where Interactive governor comes into play to overcome the limitations of ondemand governor. This governor sets an intermediate freq as its first step to ramp upon high CPU load detected. Besides a timer is set at each frequency step. The intermediate frequency waits and decides whether to ramp up further or move down depending on timer and load imposed. With this approach the CPU cycles go less, the Thermal aspects are less varying and the battery backup is noticeably better in foreground usage. Thereby, this governor is now used as default governor in almost all newer phones that come out of box. You may check using apps like CPU-Z  and similar other apps.

INTERACTIVE PARAMETERS:

Interactive Governor has got an wonderful set of parameters that makes easy for tweaking depending upon your usage plans. Unfortunately these parameters are not accessible for YUREKA via any of kernel tuning apps. This post is mainly to overcome this limitation.

above_hispeed_delay:
This is the hold down timer set at every intermediate freq in order to decide whether CPU should scale to higher or lower based on load. Higher the value lower the max CPU freq hit.
For example, 25000 800000:50000 960000:50000
This says default hold down timer for ramping CPU freq is 25ms. Once it reaches 800MHz then it hold down for 50ms and 50ms at 960MHz respectively.

boost and boostpulse duration:
These 2 parameters are additional to interactive governor. They are meant to boost the freq on touch. This might sound indulging into normal interactive parameters, so I would ignore leaving them off.

go_hispeed_load:
This is the load defined for immediate bumping to high speed freq for faster execution of tasks. If the load is below this value then the CPU scale to some lower freq below the hi speed freq set.
For example: 90
Reaching this load hi speed freq is hit. Below this load lower intermediate freq below hi speed freq defined.

hispeed_freq:
This is the freq set to accomplish immediate completion of heavy load.
For example: 800000
It means 800MHz.

min_sample_time:
This is the minimum amount of time the governor must wait at a given frequency until it can decide to reduce the frequency.

target_loads:
This defines the load you allot for every frequency step.
For example: 90 400000:40 800000:70
it means load target is 90. Within this if the load reaches 40 then 400MHz is used and hold down timer is run to decide whether to ramp further up or down.

timer_rate:
This is the periodic time for the governor to make calculations on the CPU load.
For example: 30000
This means governor will began doing cpu load calculations every 30ms.

timer_slack:
This is to overcome special case scenarios. Imagine a situation where CPU load goes 100% and interactive is inactive due 30ms delay defined in timer. In such case, the governor will run to max CPU freq to take off the load. But then the power dissipation be more due running at max freq. So to over this a threshold is defined in timer slack, which makes load follow interactive governor.

COMING TO END OF GUIDE.

How do I apply these settings for Yureka..?
Refer this file “99vjIactive” which is basically a init.d script. Read through the commands. I assume you would have basic knowledge about Unix commands. You may execute each line via Terminal app OR copy the contents of the file into Notepad++ and save it. Remove the file extension (init.d scripts don’t have any file extension). Copy the file and paste in /system/etc/init.d folder.  Change the permissions of the copied file as -rwxrwxrwx (777).

For example: The attached file is 99vjIactive.docx. You will need to open this file and copy contents to Notepad++, save it. And in end remove the file extension .docx before transferring this file onto phone.

EXTRAS:
We have 2 clusters in our Yureka named as cluster0 and cluster1. Now Cluster 0 holds a batch from core0-3 and cluster1 holds a batch from core4-7.

How do we tweak interactive in these Cluster’s individually..?
Answer is tweak core0 for affecting batch of cluster0 and tweak core4 for affecting batch of cluster1

My kernel doesn’t have init.d support, how do I execute..?
UNIVERSAL INIT.D

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s