[ref][tweaks] kernel governors

Download [REF][TWEAKS] Kernel Governors

Post on 30-Dec-2015




0 download

Embed Size (px)


[REF][TWEAKS] Kernel Governors


  • Check out the latest episodes of XDA Developer TV.

    Print Email

    Page 1 of 50 1 22 33 1111 >> >>>> ++POST REPLYPOST REPLY

    [REF][TWEAKS] Kernel Governors, Modules, I/O Schedulers, CPU Tweaks, AIO App Congs[REF][TWEAKS] Kernel Governors, Modules, I/O Schedulers, CPU Tweaks, AIO App Congs Share Thread:

    30th November 2011, 03:48 PM (Last edited by droidphile; 15th September 2012 at 05:38 PM.) Reason: Added LulzactiveQ #1

    > Samsung Galaxy S II I9100 > Galaxy S II General > [REF][TWEAKS] Kernel Governors, Modules, I/O Schedulers, CPU Tweaks, AIO App Congs

    Newsworthy Thread?



    Recognized Contributor - OPThanks Meter 3777

    Posts: 912Join Date: Jul 2011Location: Bangalore


    [REF][TWEAKS] Kernel Governors, Modules, I/O Schedulers, CPU Tweaks, AIO App Congs

    Reorganized overowing Posts to t into 5 Posts. [Feb 3]Most of us are ash maniacs, and we do it a lot. But after a kernel ash, we wonder:

    Q1. "OK i have ashed this xyz kernel. What're all these governors? How do i know which one is the best for me? How do i tweak them to bias their characters towards Battery-life/Performance/Balance between the Two".Q2. "What's the fuzz about these modules that comes with the kernel. How do i use them. Are they any good. Is it OK to neglect them?"Q3. "What roles does an i/o scheduler play? How to choose a reliable i/o scheduler?"Q4. "Can i have more control on CPU? More info and tweaks on dual core CPU, bus frequency, etc?"Q5. "Better understanding on impact of different values for basic/advanced parameters in the Kernel Cong App, so that i can tweak the settings according to my taste?"Hope this thread could give you answers for all these questions. We're covering governors, modules, i/o schedulers that comes with Siyah kernel, plus more. That should cover almost allthe popular governors/modules/io schedulers! Many people seem to get lost in Kernel dev threads without getting answers about governors and such.

    The info in this thread holds good for non-siyah kernel users too. You should nd here, info on most of the governors/modules/io schedulers in your kernel if not all.

    Thanks To1) Gokhanmoral for his mighty sweet Siyah Kernel which inspired me to write this thread.2) Moderators for squeezing in extra posts when i ran out of space to t everything in only 3 reserved posts.3) Users/Readers for your warm comments.



    I) MANUAL:These are the 19 governors we're talking about.

    1) Ondemand2) Ondemandx3) Conservative4) Interactive5) Interactivex6) Lulzactive7) Lulzactiveq8) Smartass9) SmartassV210) Intellidemand11) Lazy12) Lagfree13) Lionheart14) LionheartX15) Brazilianwax16) SavagedZen17) Userspacce18) Powersave19) Performance

    NOTE: Info on Samsung's own multi-core aware governor - Pegasusq is here

    1) Ondemand:Default governor in almost all stock kernels. One main goal of the ondemand governor is to switch to max frequency as soon as there is a CPU activity detected to ensure theresponsiveness of the system. (You can change this behavior using smooth scaling parameters, refer Siyah tweaks at the end of 3rd post.) Effectively, it uses the CPU busy time as theanswer to "how critical is performance right now" question. So Ondemand jumps to maximum frequency when CPU is busy and decreases the frequency gradually when CPU is lessloaded/apporaching idle. Even though many of us consider this a reliable governor, it falls short on battery saving and performance on default settings. One potential reason for ondemandgovernor being not very power efcient is that the governor decide the next target frequency by instant requirement during sampling interval. The instant requirement can responsequickly to workload change, but it does not usually reect workload real CPU usage requirement in a small longer time and it possibly causes frequently change between highest andlowest frequency.

    2) Ondemandx:Basically an ondemand with suspend/wake proles. This governor is supposed to be a battery friendly ondemand. When screen is off, max frequency is capped at 500 mhz. Even thoughondemand is the default governor in many kernel and is considered safe/stable, the support for ondemand/ondemandX depends on CPU capability to do fast frequency switching whichare very low latency frequency transitions. I have read somewhere that the performance of ondemand/ondemandx were signicantly varying for different i/o schedulers. This is not truefor most of the other governors. I personally feel ondemand/ondemandx goes best with SIO I/O scheduler.

    3) Conservative:A slower Ondemand which scales up slowly to save battery. The conservative governor is based on the ondemand governor. It functions like the Ondemand governor by dynamicallyadjusting frequencies based on processor utilization. However, the conservative governor increases and decreases CPU speed more gradually. Simply put, this governor increases thefrequency step by step on CPU load and jumps to lowest frequency on CPU idle. Conservative governor aims to dynamically adjust the CPU frequency to current utilization, withoutjumping to max frequency. The sampling_down_factor value acts as a negative multiplier of sampling_rate to reduce the frequency that the scheduler samples the CPU utilization. Forexample, if sampling_rate equal to 20,000 and sampling_down_factor is 2, the governor samples the CPU utilization every 40,000 microseconds.

    4) Interactive:Can be considered a faster ondemand. So more snappier, less battery. Interactive is designed for latency-sensitive, interactive workloads. Instead of sampling at every interval likeondemand, it determines how to scale up when CPU comes out of idle. The governor has the following advantages: 1) More consistent ramping, because existing governors do their CPUload sampling in a workqueue context, but interactive governor does this in a timer context, which gives more consistent CPU load sampling. 2) Higher priority for CPU frequencyincrease, thus giving the remaining tasks the CPU performance benet, unlike existing governors which schedule ramp-up work to occur after your performance starved tasks havecompleted. Interactive It's an intelligent Ondemand because of stability optimizations. Why??Sampling the CPU load every X ms (like Ondemand) can lead to under-powering the CPU for X ms, leading to dropped frames, stuttering UI, etc. Instead of sampling the CPU at aspecied rate, the interactive governor will check whether to scale the CPU frequency up soon after coming out of idle. When the CPU comes out of idle, a timer is congured to rewithin 1-2 ticks. If the CPU is very busy between exiting idle and when the timer res, then we assume the CPU is underpowered and ramp to max frequency.

    5) Interactivex:This is an Interactive governor with a wake prole. More battery friendly than interactive.

    User NameRemember Me?Remember Me? Forgot your password?Forgot your password?


    Search this thread

  • 6) Lulzactive:This new nd from Tegrak is based on Interactive & Smartass governors and is one of the favorites.Old Version: When workload is greater than or equal to 60%, the governor scales up CPU to next higher step. When workload is less than 60%, governor scales down CPU to next lowerstep. When screen is off, frequency is locked to global scaling minimum frequency.New Version: Three more user congurable parameters: inc_cpu_load, pump_up_step, pump_down_step. Unlike older version, this one gives more control for the user. We can set thethreshold at which governor decides to scale up/down. We can also set number of frequency steps to be skipped while polling up and down.When workload greater than or equal to inc_cpu_load, governor scales CPU pump_up_step steps up. When workload is less than inc_cpu_load, governor scales CPU downpump_down_step steps down.Example:Considerinc_cpu_load=70pump_up_step=2pump_down_step=1If current frequency=200, Every up_sampling_time Us if cpu load >= 70%, cpu is scaled up 2 steps - to 800.If current frequency =1200, Every down_sampling_time Us if cpu load < 70%, cpu is scaled down 1 step - to 1000.

    7) Lulzactiveq:Lulzactiveq is a modied lulzactive governor authored by XDA member robertobsc and is adapted in Siyah kernel for GS2 and GS3. Lulzactiveq aims to optimize the second version ofluzactive from Tegrak by a) providing an extra parameter (dec_cpu_load) to make scaling down more sensible, and b) incorporating hotplug logic to the governor. Luzactiveq is the rstever interactive based governor with hotplugging logic inbuilt (atleast the rst of its kind for the exynos platform). When CPU comes out of idle loop and it's time to make a scalingdecision, if load >= inc_cpu_load CPU is scaled up (like original luzactiveq) and if load


    30th November 2011, 03:48 PM (Last edited by droidphile; 18th March 2012 at 05:09 AM.) Reason: changes in governor tweaks #2

    another governor. Can i diminish this lag?"A. Hmm well, you can. Basically what we have to do is make the governor "poll" less often to scale-down cpu. Increase down-sampling-time of your governor (whichever parameter thatcorresponds to), so that the cpu will stay longer on a frequency before scaling down. This should eliminate the l