Tuesday 16 April 2013

part 6 of (usefull post must see) Everything about overclocking kernels governors, i/o schedulers e.t.c


6. CONFIGURE KERNEL AIO APP - 

See the previous post for detailed description of each tunable. This post is to give an idea on impact of value x or value y for a tunable.

PREFACE:
ARM processor in Exynos chip consists of four major power domains: CPU cores (and L2 cache), GPU, memory interface, and audio/video IP blocks. The tunables discussed below will directly or indirectly affect power consumptions of these domains. Please note: 1) Having an upper hand on Screen-ON power consumption is difficult. Reducing brightness, control GPU behavior and bus frequencies are almost the only ways. 2) Beyond a point we can not achieve better performance or better power saving and it's useless to tweak settings thereafter.






TAB 1 - CPU: Take control on CPU hotplugging, throttling, power saving states, etc

1) Hot-Plug Mode: You have a dual-core device. Forcing single core mode is foolishness. You have room for performance. Forcing dual core mode is also foolishness. Unwanted excess power consumption even when CPU is 'idling' is the 'minor-reason' and blocking deep idle states is the 'major-reason'. (Only first core can hit deep idle states in Exynos 4210. Never forget this!) It takes only a few micro seconds to activate/deactivate a core. So use Hotplugging.

2) loadl, loadh: Do not wait for core 1 to be over-loaded to activate second core.
Sample Values: loadl 25, loadh 75 for less aggressiveness or 25 50 for more aggressiveness.

3) loadl_scroff, loadh_scroff: Bluetooth transfers, wifi/3g downloads, music play. Tasks that can be run during screen-off state are very few. It is recommended to set threshold to 100% so that second core doesn't kick-in during screen-off state. This will help first core to hit deep idle state soon after tasks are finished.
Sample Values: loadl_scroff 50, loadh_scroff 100. Value of loadl_scroff is insignificant since Core 2 will not turn on.

4) rate, rate_cpuon, rate_scroff: Compared to governor sampling interval (in the range of micro seconds), these are normally very high values (terms of seconds or hundreds of milli seconds). Unit is jiffy. One jiffy is the time taken by one tick of the system timer. Frequency of sgs2 timer is 200hz. So the value divided by 200 gives the equivalent seconds. In a research it was found that having two cores online consumes almost same power as having a single core online.
Sample Values: rate 100 rate_cpuon 400 rate_scroff 1000. If you want to delay enabling second core, use 200 400 1000. 
Why such a high value for rate_scroff? Because loadh_scroff was set to 100%, core 2 won't kick-in when screen is off. So the value of rate_scroff doesn't matter. We're simply delaying the next sampling.

5) freq_cpu1on: CPU runs efficiently if only first core is used until about 800 mhz and both the cores are used for the higher frequencies (if the load demands).
Sample Value: 800000 (so that second core kicks-in only from frequency>=800 mhz). Or 300000 (so that core2 could be online from 500mhz onwards)

6) Idle Mode, Sched_mc: Unlike 8 idle states supported by OMAP4 of Nexus, GS2 Exynos supports only 3 idle state: IDLE, AFTR, LPA. Also, load balancing using sched_mc makes no sense on an already hotplug-enabled device.
Sample Values: Idle Mode 3 (AFTR+LPA), sched_mc 0

7) smooth_target, smooth_offset, smooth_step: If you feel there's a need for 1) throttling CPU 2) Control governor's urge to jump to maximum frequency too often, then use sensible valid non-zero values. Otherwise, leave it all zero. NOTE: Smooth scaling is enabled only for ondemand and conservative governors.
Sample Values: smooth_target 2, smooth_offset 2, smooth_step 2 for the sake of power saving and precaution. If you prefer not to interfere with governor's decision use 0 0 0.

TAB 2 - GPU: Take control on GPU domain. You decide how many FPS you want!

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: We do not want GPU to immediately scale up after scaling down to a frequency. This implies the thresholds causes overlapping of 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: Take control on touch response and brightness levels. 

1) Touch Move Sensitivity: Supported values are between 0 and 20. Lower value: more responsive. Set it too low, swipes will be registered as clicks. Set it too high...yeah do not set it high.
Sample Value: 7

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 24 (for stock experience) OR 50 0 20 (for low lowest brightness level and low highest brightness levels)

TAB 4 - MISC: Governor, Scheduler, etc

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 Frequency: Max frequency to be used by ondemand governor during suspend state (screen-off). Leave it as 500000.

4) Default CPU Governor: Use whichever you like. New 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.

Last Words: If you use scripts to set bus frequencies, i recommend leaving static bus frequency disabled. Tasks which involves a lot of GPU rendering really does a lot of Write and Read To and From memory. Let the system decide what bus frequency should be used.



FECALITY KERNEL
Thread | App - ExTweaks


TAB 1 - CPU: See above for config hints/sample values for each parameters under this tab.

1) loadh, loadl:

2) loadl_scroff, loadh_scroff:

3) rate, rate_cpuon, rate_scroff:

4) freq_cpu1on:

5) CPU Idle Mode:

TAB 2 - GPU: See above for config hints/sample values for each parameters under this tab.

1) GPU Frequency Steps:

2) GPU Voltages:

3) GPU UP and DOWN Thresholds: 

TAB 3 - MISC: See above for config hints/sample values for each parameters under this tab.

1) Backup EFS:

2) Default CPU Governor:

3) Default I/O Scheduler:

4) File Fsync Disable: If FSYNC is used, and a file is open for writing, all cached data will be written to disk. This feature helps to minimize data loss under rough conditions, where power failures can occur. Only advantage to disable per file fsync is increased performance in DB writes, etc. This can also be achieved using a different i/o scheduler. Disabling Pfsync is dangerous as it can lead to data corruption. Do not disable Pfsync.

5) Reset Fuel Gauge Chip:





TAB 1 - NEAK Options: ( can be used in similiar kernels)

1) Governors: By default, NEAK comes with Ondemand, Lulzactive and Performance only. To have more governors available, enable from the list and reboot. Conservative governor can also have lionheart tweaks enabled. (Lionheart = aggressive conservative). Selected governors will be loaded on reboots, as module(s). 

2) SCHED_MC: Yes you have read multiple times that enabling load-balancing via Linaro's Shedule Multi-Core is redundant and is of no particular use in an hotplug enabled device. Leave it unchecked.

3) AFTR Idle Mode: Enable AFTR+LPA. Use this to have better battery life. The battery life is 'bettered' by hitting deep idle states before the actual deep sleep. If and only if there are issues, leave it unchecked. Possible issues are stuttering videos/lagging gui, etc. This kinda issues arises when AFTR is hit too soon.

4) Ext4 Boost Optimizations: Enable to have remount scripts run during every boot-up. May increase disk performance.

TAB2 - OTA Downloader

Download OTA APP: Click to download Kernel OTA app. OTA app can be used to check and download new releases without visiting xda.



Q. "Even though i could understand everything you stated here about, what exactly does those sample values/recommended settings do? Will i get 8 hours screen-on and 8000 Antuntu?"
A. We have a Galaxy S2, not Nokia 1100. We should utilize and enjoy the performance of the phone. The values recommended were intended to give snappiness without compromising too-much battery life. Our definitions of 'too-much' may be different. But i assure you the difference isn't too much!

No comments:

Post a Comment