Jump to content

Welcome to CyanogenMod

Welcome to our forum. Like most online communities you must register to post, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of the CyanogenMod Forum by signing in or creating an account. You can even sign in with your Facebook or Twitter account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get automatic updates
  • Get your own profile and make new friends
  • Download files attached to the forum.
  • Customize your experience here
  • Share your CyanogenMod experience!
Guest Message by DevFuse
 

CPU Governors


  • Please log in to reply
9 replies to this topic

#1 echo

echo
  • Members
  • 17 posts
  • Twitter:ryneganon
  • Device Model:
    |3|
  • CM Version:
    5.0.7.1
  • Recovery Image:
    ClockworkMod

Posted 22 June 2010 - 09:40 PM

In SetCPU, there are several different CPU governors to select. The default, and the one most people use, is ondemand. However, I was looking and I noticed that when it was ondemand, it wasn't staying within my defined speeds (I had it set to 1100 max, 900min, and it was at 800mhz). So I went to userspace instead, and it's set to the speed that I have SetCPU at.

Is there any advantage of using one over the other? I know that powersave tends to keep it at the lower end, and performance keeps it high, but what do the others do?

#2 JoelWRX

JoelWRX
  • Members
  • 81 posts
  • Twitter:@Joel004
  • Device Model:
    |1|3|
  • CM Version:
    5.0.7.1
  • Recovery Image:
    ClockworkMod

Posted 22 June 2010 - 09:42 PM

Conservative one scales the cpu gradually example if your min is 250 and max is 1000 it'll scale from 250>550>800 etc as needed

#3 AbsoluteZero

AbsoluteZero

    Droid Moderator

  • Moderators
  • 1542 posts
  • Country:
    us - United States
  • Location:
    Washington DC
  • Device Model:
    N5,motox,N4,N7,SGN,TP,D1
  • CM Version:
    stock,stock,CM10.2,CM10.2,CM10.1,CM9,N#174
  • Recovery Image:
    ClockworkMod

Posted 22 June 2010 - 09:45 PM

View Postecho, on 22 June 2010 - 09:40 PM, said:

In SetCPU, there are several different CPU governors to select. The default, and the one most people use, is ondemand. However, I was looking and I noticed that when it was ondemand, it wasn't staying within my defined speeds (I had it set to 1100 max, 900min, and it was at 800mhz). So I went to userspace instead, and it's set to the speed that I have SetCPU at.

Is there any advantage of using one over the other? I know that powersave tends to keep it at the lower end, and performance keeps it high, but what do the others do?
Unlike powersave and performance which work as you said, OnDemand basically switches between your Max and Min as needed. However, it shouldn't be dropping outside of your defined max and min UNLESS you have a profile that was active at the time you checked. Check your profiles to see if one may have been active during that time. What kernel are you using that has 800 and 900 slots?

If you want more info on SetCPU and it's settings ---> http://www.pokedev.com/setcpu/

Quote

The CPU Governor drop down box contains a list of CPU  "governors" that the phone can use. Available governors will vary with  your specific device and kernel. The Performance governor, called  "Always Max" on previous versions of SetCPU, allows your phone to run at  maximum speed, ignoring all power saving functions. The "ondemand"  setting is default, and scales the phone between the maximum and minimum  speeds. On some kernels, the "conservative" governor is also available.  The "conservative" governor ramps up the CPU more slowly than the  "ondemand" governor, leading to slower responsiveness but better battery  performance.
More details on the site.


#4 Dave M

Dave M
  • Members
  • 10 posts
  • Device Model:
    |3|
  • CM Version:
    5.7
  • Recovery Image:
    ClockworkMod

Posted 22 June 2010 - 11:24 PM

I have seen  oddities on froyo like this.
just now went back to cm and so far not seeing it.

#5 bpyazel

bpyazel
  • Members
  • 161 posts
  • Country:
    us - United States
  • Device Model:
    Moto Droid
  • CM Version:
    CM 6.0.0
  • Recovery Image:
    ClockworkMod

Posted 22 June 2010 - 11:58 PM

View PostAbsolute Zero, on 22 June 2010 - 09:45 PM, said:

Unlike powersave and performance which work as you said, OnDemand basically switches between your Max and Min as needed. However, it shouldn't be dropping outside of your defined max and min UNLESS you have a profile that was active at the time you checked. Check your profiles to see if one may have been active during that time. What kernel are you using that has 800 and 900 slots?

If you want more info on SetCPU and it's settings ---> http://www.pokedev.com/setcpu/

More details on the site.
[/font]


It WILL go outside your parameters if the phone is plugged into an AC power supply (NOT USB).  I posted this in forums once before.  Your min speed will change to whatever the 3rd lowest setting for that kernel when plugged in.  Example: If you have a kernel that runs 250, 500, 700, 900, when plugged into AC your min setting will now be 700 despite any settings in SetCPU.  Note also that SetCPU will not change what it displays for min setting, but you can see that it does change if you watch the current speed.  This happens with all roms and all kernels that I'm aware (I tested quite a few).

#6 AbsoluteZero

AbsoluteZero

    Droid Moderator

  • Moderators
  • 1542 posts
  • Country:
    us - United States
  • Location:
    Washington DC
  • Device Model:
    N5,motox,N4,N7,SGN,TP,D1
  • CM Version:
    stock,stock,CM10.2,CM10.2,CM10.1,CM9,N#174
  • Recovery Image:
    ClockworkMod

Posted 23 June 2010 - 12:42 AM

View Postbpyazel, on 22 June 2010 - 11:58 PM, said:

It WILL go outside your parameters if the phone is plugged into an AC power supply (NOT USB).  I posted this in forums once before.  Your min speed will change to whatever the 3rd lowest setting for that kernel when plugged in.  Example: If you have a kernel that runs 250, 500, 700, 900, when plugged into AC your min setting will now be 700 despite any settings in SetCPU.  Note also that SetCPU will not change what it displays for min setting, but you can see that it does change if you watch the current speed.  This happens with all roms and all kernels that I'm aware (I tested quite a few).
Ok, I agree and that has been known for a while. I wasn't trying to cover all cases. I suppose I should have said "except when charging from a wall outlet" but if he was charging I guess I assumed he'd say "while charging". Appologies to anyone that thought my short explanation was all there was to say. I guess I was hoping the site I linked would have straightened out any confusions and explained more. Thanks though.

#7 Droid_Rage

Droid_Rage
  • Members
  • 57 posts
  • Country:
    us - United States
  • Device Model:
    Motorola Droid
  • CM Version:
    Nightlies
  • Recovery Image:
    ClockworkMod

Posted 23 June 2010 - 01:11 AM

View PostAbsolute Zero, on 23 June 2010 - 12:42 AM, said:

Ok, I agree and that has been known for a while. I wasn't trying to cover all cases. I suppose I should have said "except when charging from a wall outlet" but if he was charging I guess I assumed he'd say "while charging". Appologies to anyone that thought my short explanation was all there was to say. I guess I was hoping the site I linked would have straightened out any confusions and explained more. Thanks though.

Thanks for posting the link! I had always wondered what the advanced setting were for.

#8 rockingondrums

rockingondrums
  • Members
  • 318 posts
  • Twitter:beatsandmelody
  • Country:
    us - United States
  • Location:
    San Jose, CA
  • Device Model:
    SGN VZW
  • CM Version:
    CM 10.1 nightlies
  • Recovery Image:
    TWRP

Posted 23 June 2010 - 03:45 AM

The advanced settings have to do with voltages IIRC. I would advise against changing those.

Now the thing I'VE always wondered: What's the point of the powersave governor if all it does statically remain at the lowest clock speed? I mean any situation where you want it to remain at one speed, you could just set the profile to have the same max and min speed...

#9 Porter

Porter
  • Donators
  • 63 posts
  • Country:
    us - United States
  • Location:
    Roanoke, VA
  • Device Model:
    Galaxy Nexus LTE
  • CM Version:
    CM10
  • Recovery Image:
    ClockworkMod

Posted 23 June 2010 - 12:16 PM

View Postrockingondrums, on 23 June 2010 - 03:45 AM, said:

The advanced settings have to do with voltages IIRC. I would advise against changing those.

Now the thing I'VE always wondered: What's the point of the powersave governor if all it does statically remain at the lowest clock speed? I mean any situation where you want it to remain at one speed, you could just set the profile to have the same max and min speed...
These governors are built-in functions of the linux kernel.  You're thinking of this in context of Android and SetCPU, but in reality these are clock governor settings that are available on any linux-based system.  The benefit of a "powersave" governor in that context should be obvious... most systems don't have a profile manager, or any concept of profiles at all, so the governors are the primary control method, and they use the native clocking options of the CPU, like Intel SpeedStep or similar.

#10 hackworks

hackworks
  • Members
  • 29 posts
  • Twitter:hackworks
  • Country:
    in - India
  • Location:
    Bangalore
  • Device Model:
    HTC Wildfire (buzz)
  • CM Version:
    CM 7 nightly (own builds at times)
  • Recovery Image:
    ClockworkMod

Posted 19 November 2010 - 04:55 AM

View Postrockingondrums, on 23 June 2010 - 03:45 AM, said:

Now the thing I'VE always wondered: What's the point of the powersave governor if all it does statically remain at the lowest clock speed? I mean any situation where you want it to remain at one speed, you could just set the profile to have the same max and min speed...

I am learning this myself (trying to go through the code too). Using some governor and setting same value for min and max to get a 'powersave' like profile would still end up calling the governor code on CPU demand. Some extra code gets executed which sets the min and max to same. This extra code in itself would burn some power.
Looking at the code 'cpufreq_powersave.c' vs 'cpufreq_ondemand.c', there is significant extra decision making in 'ondemand' compared to 'powersave'.