[Galaxy S II General] droidphile:
ICS Kernel AIO Configuration Apps: How To Mess With Them

7. CONFIGURE KERNEL AIO APP - ICS​

We heard a lot of "ICS is more mutlithreaded and multi core aware". Can a 3.0 kernel make the best out of dual core Arm Cortex A9? Let's tweak and see.

SIYAH KERNEL

Thread | App - ExTweaks​

TAB 1 - CPU:

Hotplugging, Smooth Scaling, Idle States

1) Hotplug Mode: Best practice is to use hotplugging instead of single/dual core modes and setup settings in such a way that until about 800 mhz, only first core is active. This is energy efficient because above 800mhz, the voltage increase is steep. So static power consumption increases steeply and it's better to have two cores handling tasks from here on. Having only one core online roughly saves about 55% power compared to two cores online. But it's not worth using single core for all frequencies since the device is capable of more.

Sample Values:CPU Hotplug

2) loadh0, loadl1: Values are so self explanatory. Load-High-0 and Load-Low-1. Thresholds to turn ON and turn OFF second core. When load on first core is greater than or equal to loadh0, second core comes online. When average load on both cores is less than loadl1, second core goes offline. It's better not to overload first core before turning second core on.

Sample Values: loadl 20, loadh 50 for less aggressiveness or 20 30 for more aggressiveness. ICS hotplugging logic has some difference from GB hotplugging. To get the same responsiveness as in gingerbread, i had to use more aggressive(reduced) thresholds.

3) min_rq, load_rq: As of now, what these params does is unknown. I think it's something to do with CPU run queue and enhance load balancing on cores. I'm not sure.

4) rate: Rate is the sampling interval for hutplugging for screen-ON state. Every rate jiffies, load is sampled and if found to be more than loadh0, second core is turned ON. One jiffy is the time taken to complete one tick of the system timer. Frequency of sgs2 timer is 200hz. So the value divided by 200 gives the equivalent seconds or in other words, one jiffy = 5 milliseconds in GS2 terms.

Sample Values: rate 100.

5) freq_min: 'Threshold' frequency for second core to turn on during hotplugging. If current frequency <= freq_min, second core will not turn on even if the load has crossed loadh0. CPU runs efficiently if only single core is used until about 800 mhz and both the cores are used only for the higher frequencies. Because voltage increase is intense past 800 mhz.

Sample Value: 800000 (so that second core kicks-in only from frequency>800 mhz).

6) CPU Idle States: Unlike 8 idle states supported by OMAP4 of Nexus, GS2 Exynos supports only 3 idle state: IDLE, AFTR, LPA.

IDLE - Clock is gated but power on CPU core remains (static power consumption still active)

AFTR - Clock is gated, power on CPU core is removed and L2 cache power remains. Static power consumption mostly eliminated.

LPA - Cache power removed.

AFTR or LPA cannot be entered if second core is active.

Sample Values: Idle Mode 3 (AFTR+LPA), to save battery.

7) Sched_mc: Disable sched_mc. There could be only one situation where load balancing or weird-overloading of first core can be useful - when we use dual core mode. Sched_mc is valid only when both cores are online. Since it doesn't go well with hotplugging logic, if someone uses dual-core mode sched_mc is worth a try to handle task loads on cores.

Sample Values: sched_mc 0

8) smooth_target, smooth_offset, smooth_step: These params helps in 1) Throttling CPU at higher temperatures 2) Control Ondemand based governors' urge to jump to maximum frequency too often by jumping the CPU to an intermediate frequency first. If we're not interested in either of them, leave it as 0 0 0. NOTE: Smooth scaling is enabled only for Ondemand and Conservative governors.

Sample Values: smooth_target 2, smooth_offset 2, smooth_step 2

TAB 2 - GPU:

GPU behavior. This matters more than CPU UV w.r.t Screen-On power savings!

1) GPU Frequency Steps: There are plenty of frequencies supported by the MALI400. Valid frequencies are 400/(x*0.5) where 2 <= x <= 20. 400 267 200 160 133 114 100 89 80 73 67 62 57 53 50 47 44 42 40 are valid frequencies. I would recommend using energetically efficient GPU freqs.

Sample Values: 160 200 267. If you want more frames, use 200 267 400.

2) GPU Voltages: GPU Undervolting (if not taken care of) has some worse side effects compared to CPU UV. Your game will crash, your navigation app will crash. I'd recommend to use stock voltages. Or just a -50mV UV for each step.

3) GPU UP and DOWN Thresholds: The four thresholds are threshold to switch to second step, switch back to first step, switch to third step, switch back to second step. We do not want GPU to immediately scale up after scaling down to a frequency. This implies the thresholds are overlapping load-evaluations. Use up-thresholds of the range 80-90. To calculate down-thresholds in such a way that overlapping is prevented, for a set of two freqs, find out what percentage of higher frequency is lower frequency, and reduce 5-10 % from the resultant value.

(If you like the 'good old' two frequency step, set Threshold-2-UP to 100 so that only First two steps are used and third step will never be active)

Sample Values: 85 70 85 65 (Assuming GPU freqs are 160 200 267). OR 85 65 85 55 (If GPU freqs are 200 267 400).

4) GPU Stay Counts: No of cycles to stay at each GPU step. It is recommended to leave it as default 1 1 1.

Sample Values: 1 1 1

TAB 3 - SCREEN:

Touch sensitivity, Brightness curve

1) Touch Move Sensitivity: Supported values are between 0 and 20. Lower value is more responsive. But setting it too low will cause swipes to be registered as clicks.

Sample Value: 7 pixel

2) min_bl,min_gamma, max_gamma: If you don't want lowest brightness to be very low, use 30 1 24.

Sample Values: 30 1 20 (for stock experience)

OR 50 0 20 (for low lowest brightness level and low highest brightness levels)

TAB 4 - MISC:

Governor, Scheduler, Miscellaneous tweaks

1) Backup EFS: Backup your precious EFS partition to use in the future to recover a lost IMEI.

2) Android Logger: Enable/Disable Logging. Leave it enabled.

3) Default Ondemand Suspend Freq: Max frequency that will be used during screen-off state if Ondemand is the active governor. 500000 (500 mhz) is the most sensible value.

4) Default CPU Governor: Use whichever you like. Ondemand is good enough.

5) Default I/O Scheduler: Use whichever you like. I use sio/bfq.

6) Charge Current: Since it was proved that i9100 Li-ion battery charge current can only be either of 450mA and 650mA, leave it at AC:650, MISC:450,USB:450 OR AC:650 MISC:650 USB:450

7) Reset Fuel Gauge Chip: After a low-battery reboot if the battery shows very low and incorrect percentages since true battery capacity failed to accurately synchronize with the fuel gauge, press the button and wait for sometime. An alternative is to charge full->discharge full->charge full.

8) Remove Root: Some apps detects root and refuse to work if found. In such cases, or if some apps are freezing in a while, remove root and re-install root. Pressing the button will remove Superuser.apk and SU binary.

9) Install Root: Tries to install root after a removal. Copies Superuser.apk and SU binary. If this fails, check 'Auto-Install Root' and reboot.

This post will be updated with more releases of the kernel.