I heard some people talking about governors and was wondering if someone could explain the them to me. also what does Min CPU frequency and Max CPU frequency?
Min and Max frequency mean the Min and Max speed of the processor. So instead of running full speed for a minimal task it can be powered down as to not waste energy. The governor is what changes the speed of the processor in order to efficiently complete its task. Android is usually equipped with a few different governors each with a set of instructions on how to deal with those different tasks.
Does that help?
yes thank you, but I still don't know which one to have on. the one I have are ondemand, userspace, conservative and performance
Ondemand basically adjusts the speed to whats needed. Userspace does nothing from what I understand. Conservative keeps the CPU speed as low as it can to conserve energy but causes the device to be slow and sometimes unresponsive. Performance cranks up the CPU speed to tthe Max at all times.
I use Ondemand for most situations. Performance when my device is plugged in.
Thanks, that helps alot
No problem. This community has helped me out a great deal. I'm no expert so I try and help when I can.
Related
I've been using setcpu for a while now, but have never bothered to mess with the advanced settings. Searching around I have only found out what most of this stuff means, but I'm missing some still. I thought I would share my findings. I have included SetCPU's descriptions (in italics) supplemented with my findings.
Governor choices (I'm using king's bfs kernel #1 on fresh 3.1.0.2) -
Ondemand - Uses the highest frequency when tasks are started, decreases step by step
Conservative - Increases frequency step by step, decreases instantly
Interactive - I couldn't figure this one out... any help?
Powersave - Uses the lowest possible clock speed to complete its tasks
Userspace - Manual controll of the frequency
Performance - Always uses the highest clock speed
Advanced Settings -
Sampling Rate - An interval (in microseconds) at which the governor will poll for updates. When this happens, the governor will decide whether to scale the CPU up or down. It uses such little power that it is better at lower values when using profiles such as screen off.
Up Threshold (1%-100%) - Defines a percentage from 1% to 100%. When the CPU load reaches this point, the governor will scale the CPU up. When using low min values (245), this happens instantly, using higher values (768) it overclocks less often. With Conservative lower values are better because it slowly increases your clock speed to what you need, with Ondemand, higher is better, as it overclocks less often.
Down Threshold (1%-100%) (conservative only) - Defines a percentage from 1% to 100%. When the CPU load reaches this point, the governor will scale the CPU down. Higher values will offer more aggressive battery saving, lowering the clock speed quicker.
Ignore Nice Load (0/1) - If this value is "1," the system will ignore "Nice" processes when deciding to scale up or down. I need a little more info for this one, what exactly is a nice process? DO NOT GOOGLE 'NICE LOAD' ESPECIALLY AT WORK OR AROUND CHILDREN/WIFE
Freq Step (0%-100%) (conservative only) - Defines how much (as a percentage of the maximum CPU speed) the conservative governor will increase the CPU speed by each time the CPU load reaches the Up Threshold. Increased the value slightly to be able to overclock quicker, but not to high to avoid unnecessary overclocking.
Powersave Bias (0-1000) (ondemand only) - Setting this value higher will "bias" the governor toward lower frequencies. This is a percentage, where 1000 is 100%, 100 is 10%, and 0 is 0%. The ondemand governor will scale the CPU to a frequency lower than its "target" speed according to this value. Gives ondemand some more battery saving potential. High values give worse performance than conservative with equal or worse battery saving. If you want the performance of ondemand with some more battery use values under 200.
I hope this info was helpful to someone, and here are my setcpu settings. I have attempted to target 150-175ms for short and 350-400ms for long benchmarks to match my performance governor and save battery at the same time.
With ondemand I get about 170ms short and 380ms long. I use 90 for up and 50 for powersave. The performance is slightly better than the default settings, and the battery is about equal. I might play with this more, as it should hit the same values as performance with better battery life.
In conservative long benchmarks in setcpu are actually faster than short ones because it takes setcpu time to adjust the speed. Run a short one immediately after a long one to see its actual value. Up changed 75 and down to 25, not much of a change, but drastic performance increase with no battery change. I also increased freq step to 10% to obtain higher speeds faster. Getting the same 170ms short and 370ms long.
My Settings
Conservative 245-1190
Temp > 50C - 768 conservative
Screen Off - 499 ondemand (allows for the screen to be unlocked faster, especially useful with incoming calls)
Charging/Full - 1190 performance
Battery < 15% - 652 conservative
Sampling - 200000
Up Thresh - 75
Down Thresh -25
Ignore Nice - 0
Freq - 10
More DFS Info
SetCPU Info
davebu said:
DO NOT GOOGLE 'NICE LOAD' ESPECIALLY AT WORK OR AROUND CHILDREN/WIFE
Click to expand...
Click to collapse
LMAO 10chars
HondaCop said:
LMAO 10chars
Click to expand...
Click to collapse
Yeah. I almost spit out my Vanilla Coke on that one. LOL
Anytime have any info about nice load or anything to add?
Sent from my HTC EVO 4G.
HondaCop said:
LMAO 10chars
Click to expand...
Click to collapse
I missed this yesterday... Post of the day in my opinion
Thanks dave...good write up
This is what I found about the interactive governor in github:
cpufreq: interactive: New 'interactive' governor
New interactive governor.
This governor is designed for latency sensitive workloads, UI interaction for
example.
Advantages:
+ significantly more responsive to ramp cpu up when required (UI interaction)
+ more consistent ramping, existing governors do their cpu load sampling in a
workqueue context, the 'interactive' governor does this in a timer context, which
gives more consistent cpu load sampling.
+ higher priority for cpu frequency increase, rt_workqueue is used for scaling
up, giving the remaining tasks the cpu performance benefit, unlike existing
governors which schedule rampup work to occur after your performance starved
tasks have completed.
Existing governors sample cpu load at a particular rate, typically
every X ms. Which can lead to under powering UI threads when the user has
interacted with an idle system until the next sample period happns.
The 'interactive' governor has a different approach. Instead of sampling the cpu
at a specified rate, the governor will scale the cpu frequency up when coming
out of idle. When the cpu comes out of idle, a timer is configured to fire
within 1-2 ticks. If the cpu is 100% busy from exiting idle to when the timer
fires then we assume the cpu is underpowered and ramp to MAX speed.
If the cpu was not 100% busy, then the governor evaluates the cpu load over the
last 'min_sample_rate' (default 50000 uS) to determine the cpu speed to ramp down
to.
There is only one tuneable for this governor:
/sys/devices/system/cpu/cpufreq/interactive/min_sample_rate:
The minimum ammount of time to spend at the current frequency before
ramping down. This is to ensure that the governor has seen enough
historic cpu load data to determine the appropriate workload.
Default is 5000 uS.
Also, in the original application thread as explained by the dev, "nice" processes are:
2. Nice processes are used by the IO scheduler to designate a low-priority process. Ignore nice load basically tells ondemand to disregard processes with higher nice values.
Good topic. You covered the bases pretty well. Glad someone finally put this together as it is useful to know. Now prepare for 1000 threads in the next month asking for the information you just posted.
hey question. i went and purchased SetCPU and attempted to follow your instruction. problem is, whenever SetCPU tries to gain super user permission, it says "no root access granted. Are applications allowed root access?" i dunno what to do. can someone advise me?
Umm, is your phone rooted?
Sent from the void...
Yessir. Since day 2 ^_^ (plus its in my sig)
Sent from my Evo using Tapatalk
SilverStone641 said:
Yessir. Since day 2 ^_^ (plus its in my sig)
Sent from my Evo using Tapatalk
Click to expand...
Click to collapse
Try uninstalling and reinstalling it.
Then double check all of your superuser settings.
SilverStone641 said:
Yessir. Since day 2 ^_^ (plus its in my sig)
Sent from my Evo using Tapatalk
Click to expand...
Click to collapse
Sorry, using the xda app which doesn't display the sig.
Sent from the void...
So, as far as speed/responsiveness of governors goes:
Fastest ------------------------------------------------------> Slowest
Performance ------> ondemand ------> Interactive? ------> Conservative
Poor battery consumption --------------------> Best battery consumption
This thread is exactly what i was looking for, thanks for the detailed explanation of the what and why.
Will try it out this week with Fresh 3.1 and KK#8.
this thread helped a lot, i was just in setCPU messing around with things, now i can use this thread to help get what i want. i bookmark'd the hell out of this thread
Thanks...OP...hopefully people will read it first...try things..then ask questions...
I am still working to see how to get the best battery life from cm6 and snap..
Thanks for the helpful post!
I experienced a "nice load" when I unboxed my EVO. Anyway the only setting I use is:
Screen off: 245/128 on demand.
Works for me. And thanks for this helpful post to help us understand all that technical mumbo jumbo.
So I got a rooted Vanilla install of the latest Sprint OTA Froyo build on my EVO. (the 3.29.651.5 build).
I purchased the latest version of SetCPU (2.03) last night and used the autodetect method for the CPU governor.
I notice on my EVO that I only have these 3 options:
Scaling:
ondemand, userspace and performance....
Is this normal to not have the conservative setting since I have the defacto kernel with a vanilla rom?
Thanks
Sheldon
Okay, so I figured it out, my default kernel does not have these other options, oh well......
Nice app though, so far its working really well.
I have been kicking around getting SetCPU to do some auto CPU throttling to help with battery life, but I'm uncertain if I actually would see a lot of improvement.
The reason I am unsure, is I installed some CPU info widgets, and they report a CPU frequency that already seems to throttle. Is it actually doing throttling or are the widgets just not accurate? If it is throttling, is there still a case to be made for SetCPU?
Thanks!
If you want something that's just set and forget, SetCPU alone will do very little to extend usage time.
The stock kernel does throttle the CPU.
SetCPU gives you control over how your (rooted) phone throttles it's CPU, it allows you to change the CPU governor, set minimum and maximum CPU speeds, or overclock with a compatible kernel.
CPU Spy will give you a break down of what speeds the CPU is using and how often.
thanks for the info!
Interactive - Instead of sampling the cpu at a specified rate, the governor will scale the cpu frequency up when coming out of idle. When the cpu comes out of idle, a timer is configured to fire within 1-2 ticks. If the cpu is 100% busy from exiting idle to when the timer fires then we assume the cpu is underpowered and ramp to MAX speed.
Smartass- Is an improved version of interactive governor
Ondemand – Available in most kernels, and the default governor in most kernels. When the CPU load reaches a certain point (see “up threshold” in Advanced Settings), ondemand will rapidly scale the CPU up to meet demand, then gradually scale the CPU down when it isn't needed.
Conservative– Available in some kernels. It is similar to the ondemand governor, but will scale the CPU up more gradually to better fit demand. Conservative provides a less responsive experience than ondemand, but can save battery.
Performance – Available in most kernels. It will keep the CPU running at the “max” set value at all times. This is a bit more efficient than simply setting “max” and “min” to the same value and using ondemand because the system will not waste resources scanning for CPU load.
Powersave – Available in some kernels. It will keep the CPU running at the “min” set value at all times.
Userspace– A method for controlling the CPU speed that isn't currently used by SetCPU. For best results, do not use the userspace governor.
Hope those will able to help newbies to SetCPU or No Frills CPU.
Credit to LeeDroid for the infos
I believe Interactive is the most responsive kernel out there. Faster than ondemand. So it'll technically use more power when you are using the phone.
HOWEVER, isn't the best feature of Smartass the ability to cap frequencies when the screen is OFF? This essentially negates the need for using SetCPU to limit frequenceis when screen is off. Yes it's an improved version of interactive, but it should be just as responsive, but with these set limits in. I'm just not sure what the specific rules are. I used it for my Moto Milestone, but I'm unsure of what the rules are here.
window7 said:
Interactive - Instead of sampling the cpu at a specified rate, the governor will scale the cpu frequency up when coming out of idle. When the cpu comes out of idle, a timer is configured to fire within 1-2 ticks. If the cpu is 100% busy from exiting idle to when the timer fires then we assume the cpu is underpowered and ramp to MAX speed.
Smartass - Is an improved version of interactive governor
Ondemand – Available in most kernels, and the default governor in most kernels. When the CPU load reaches a certain point (see “up threshold” in Advanced Settings), ondemand will rapidly scale the CPU up to meet demand, then gradually scale the CPU down when it isn't needed.
Conservative – Available in some kernels. It is similar to the ondemand governor, but will scale the CPU up more gradually to better fit demand. Conservative provides a less responsive experience than ondemand, but can save battery.
Performance – Available in most kernels. It will keep the CPU running at the “max” set value at all times. This is a bit more efficient than simply setting “max” and “min” to the same value and using ondemand because the system will not waste resources scanning for CPU load.
Powersave – Available in some kernels. It will keep the CPU running at the “min” set value at all times.
Userspace – A method for controlling the CPU speed that isn't currently used by SetCPU. For best results, do not use the userspace governor.
Hope those will able to help newbies to SetCPU or No Frills CPU.
And do correct me if I am wrong. Thank you
Click to expand...
Click to collapse
You should credit the source you copy and pasted that from. Or even better post the link.
Sent from my Nexus S using XDA App
dmo580 said:
I believe Interactive is the most responsive kernel out there. Faster than ondemand. So it'll technically use more power when you are using the phone.
HOWEVER, isn't the best feature of Smartass the ability to cap frequencies when the screen is OFF? This essentially negates the need for using SetCPU to limit frequenceis when screen is off. Yes it's an improved version of interactive, but it should be just as responsive, but with these set limits in. I'm just not sure what the specific rules are. I used it for my Moto Milestone, but I'm unsure of what the rules are here.
Click to expand...
Click to collapse
SMARTASS is a rewrite of the INTERACTIVE governor, and it moves the CPU up/down depending on whether the phone is idle/locked/ ... etc.
But some problems that I experience with SMARTASS is that my music playback sometimes stutters(?). So I'm just sticking with INTERACTIVE.
http://setcpu.com
edit:/#7 didnt seem to work right?
matt2053 said:
You should credit the source you copy and pasted that from. Or even better post the link.
Sent from my Nexus S using XDA App
Click to expand...
Click to collapse
Thanks for telling me that. I had changed it
However, I cant post the link as I cannot find the source I find it.
I only know that LeeDroid provided me the details
window7 said:
Thanks for telling me that. I had changed it
However, I cant post the link as I cannot find the source I find it.
I only know that LeeDroid provided me the details
Click to expand...
Click to collapse
I believe it comes from SetCPU's website.
Http://www.setcpu.com
Sent from my Nexus S using XDA App
olorin86 said:
SMARTASS is a rewrite of the INTERACTIVE governor, and it moves the CPU up/down depending on whether the phone is idle/locked/ ... etc.
But some problems that I experience with SMARTASS is that my music playback sometimes stutters(?). So I'm just sticking with INTERACTIVE.
Click to expand...
Click to collapse
Is this because your screen is off? Yeah, smartass has some issues when the screen is off. Main issue is wakeup and whatever else your phone has to do. I know the Netarchy kernel with smartass just got a revision lately to deal with more wake issues.
But in terms of when your screen is on smartass should function exactly like interactive. So that's why I said smartass is essentially interactive, but with those preset rules regarding screen off that you would otherwise have to create using SetCPU.
The reason you might have worse battery might be because during screen off, your phone is struggling to do work at a slower pace (ideally you shouldn't have to do much, but maybe some people's phones have a lot of stuff running in the background), and so the more time you spent with the CPU active ends up eating more power.
This is one of the arguments about Intel Atom vs. Intel i3. Both idle at the same wattage, but the i3 uses massively more power in load. Probably 2x-3x more. However, given that the i3 is like so FAST, it gets say an encoding job done in like 1/4 the time. Your overall power (Watts * time) used is actually less with the faster CPU. This might apply with the Smartass governor. If your CPU is struggling and maxing out at its cap for a long time because its not fast enough when the screen is off, then perhaps this can be an issue. Just a thought. This is why I think the max_freq for sleep should probably be set around 500-600mhz instead of like 200mhz.
But once again I'm not sure what the governor is set at right now. If someone knows, please do tel
Is this possible on Androids (mostly, this phone?) Before this I had a windows phone and I had a software where I could set a minimum and maximum cpu clock rate.. and then it will overclock dynamically as needed! If you are running a game and it needs more power, it will overclock it while the game is running.. dynamically without you having to change the clock-rate manually.
This will solve battery life problems when overclocking to 1.8ghz. There is no need for it to be draining the battery at 1.8ghz if you are only texting and probably even a 200mhz cpu can do that lol
Hope what I said makes sense.
it's easily done by installing Setcpu,provided that your phone has been rooted and kernel modded to allow overclocking.
Sent from my IDEOS X5
Actually it is already done in stock ROM without root, setCPU provides a way to change the default way of handling the CPU frequencies and governors.
The stock ROM comes right out of the factory can do "cpu stepping" itself, just like the intel "Speedstep" thing. But the factory powersaving profile (or if you wish to call the scaling) might not match our taste. Then there it comes the apps called Setcpu which enhances the cpu stepping behavior according to our preference. The enhancement considers the frequency of sampling cpu load, thresholds modifications, and other considerations.
In Setcpu, we can accord one of the following scaling setting that suits our taste. From my experience, each scaling setting behaves as follows:
ondemand - runs at Min or at Max (eg. 200 MHz or 1200 MHz)
interactive - adjusts frequencies according to the real load
conservative - behaves like "interactive" but incline to power saving
performance - always runs at Max
powersave - always runs at Min
userspace - disables Setcpu scaling and uses stock scaling
smartass - behaves like "interactive" but always runs at Min when LCD screen is off
And again, the phone must be rooted and kernel modded for Setcpu to work properly.
I've been using setcpu with conservative. I like conservative because it gives you a lot of control over the throttling of the cpu. It seems to work pretty good.
Are you getting any benefit from overclocking to 1.8GHz? I also overclocked to 1.8GHz, but I didn't see any noticeable improvement past 1.0-1.2GHz.
I like to use interactive Cox I enjoy the fast sampling rate and hence the high responsiveness.
Sent from my IDEOS X5
Personally I have not tried overclocking yet.. still need to update the kernel, but I'm afraid it might get unstable.
Didn't know that CPU could do it dynamically using different profiles.
Thanks all for the help
Tcm9669 said:
Is this possible on Androids (mostly, this phone?) Before this I had a windows phone and I had a software where I could set a minimum and maximum cpu clock rate.. and then it will overclock dynamically as needed! If you are running a game and it needs more power, it will overclock it while the game is running.. dynamically without you having to change the clock-rate manually.
This will solve battery life problems when overclocking to 1.8ghz. There is no need for it to be draining the battery at 1.8ghz if you are only texting and probably even a 200mhz cpu can do that lol
Hope what I said makes sense.
Click to expand...
Click to collapse
I have setcpu but the x5 is not listed....??
okay im sorry if this is one of the most noobish questions, but what exactly are governors , and how do they help ?
Sent from my Mytouch 4G Running Capychimps Sense 3.5 rom (v.4.0)
Cpu governors "govern" how the cpu works. There is a list somewhere that explains what a few of them do. Basically they dictate how your cpu behaves and therefore the performance you see and power consumption you experience. I'll see if I can find that list.
Edit:
- The ondemand governor is the default option used by Android. It scales the CPU speed between the minimum and maximum speeds depending on CPU load. If the system needs more speed, the kernel will rapidly scale up the CPU speed. - The conservative sets the CPU speed in a similar way to the ondemand governor, but scales the CPU up much less rapidly. This would theoretically save battery power, but may lead to less responsiveness. - The userspace governor is currently useless. It's another way for applications to set the CPU speed that SetCPU does not use. - The powersave governor always keeps the CPU at the minimum set frequency. - The performance governor always keeps the CPU at the maximum set frequency.
Except for "userspace," no matter which governor you set, the CPU will always stay within the bounds of the maximum and minimum speeds you set in SetCPU.
smartass governor -is based on the concept of the interactive governor. I have always agreed that in theory the way interactive works -by taking over the idle loop -is very attractive. I have never managed to tweak it so it would behave decently in real life. Smartass is a complete rewrite of the code plus more. I think its a success. Performance is on par with the "old" minmax and I think smartass is a bit more responsive. Battery life is hard to quantify precisely but it does spend much more time at the lower frequencies. Smartass will also cap the max frequency when sleeping to 352Mhz (or if your min frequency is higher than 352 -why?! -it will cap it to your min frequency). Lets take for example the 528/176 kernel, it will sleep at 352/176. No need for sleep profiles any more!
Sent from my HTC Glacier using XDA App
estallings15 said:
Cpu governors "govern" how the cpu works. There is a list somewhere that explains what a few of them do. Basically they dictate how your cpu behaves and therefore the performance you see and power consumption you experience. I'll see if I can find that list.
Edit:
- The ondemand governor is the default option used by Android. It scales the CPU speed between the minimum and maximum speeds depending on CPU load. If the system needs more speed, the kernel will rapidly scale up the CPU speed. - The conservative sets the CPU speed in a similar way to the ondemand governor, but scales the CPU up much less rapidly. This would theoretically save battery power, but may lead to less responsiveness. - The userspace governor is currently useless. It's another way for applications to set the CPU speed that SetCPU does not use. - The powersave governor always keeps the CPU at the minimum set frequency. - The performance governor always keeps the CPU at the maximum set frequency.
Except for "userspace," no matter which governor you set, the CPU will always stay within the bounds of the maximum and minimum speeds you set in SetCPU.
smartass governor -is based on the concept of the interactive governor. I have always agreed that in theory the way interactive works -by taking over the idle loop -is very attractive. I have never managed to tweak it so it would behave decently in real life. Smartass is a complete rewrite of the code plus more. I think its a success. Performance is on par with the "old" minmax and I think smartass is a bit more responsive. Battery life is hard to quantify precisely but it does spend much more time at the lower frequencies. Smartass will also cap the max frequency when sleeping to 352Mhz (or if your min frequency is higher than 352 -why?! -it will cap it to your min frequency). Lets take for example the 528/176 kernel, it will sleep at 352/176. No need for sleep profiles any more!
Sent from my HTC Glacier using XDA App
Click to expand...
Click to collapse
wow ! , thanks i guess im gonna get rid of my sleeping profile and start using smartass, thanks for the help
Sent from my Mytouch 4G Running Capychimps Sense 3.5 rom (v.4.0)
do you happen to know any info about smartassv2 ? , i just checked my list and i have both smartass and smartassv2
Sent from my Mytouch 4G Running Capychimps Sense 3.5 rom (v.4.0)
You're welcome! By the way, I'd appreciate it if you'd hit the Thanks button. I help people all the time and am rarely thanked. I'm starting to get a complex. Ha.
Sent from my HTC Glacier using XDA App
jjbat87 said:
do you happen to know any info about smartassv2 ? , i just checked my list and i have both smartass and smartassv2
Sent from my Mytouch 4G Running Capychimps Sense 3.5 rom (v.4.0)
Click to expand...
Click to collapse
Smart ass v2 is just an update of smart ass v1
Sent from my HTC Glacier using XDA App