Announcement

Collapse
No announcement yet.

Setting correct ondemand cpu governor policy

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Setting correct ondemand cpu governor policy

    I am unable to set correct 'ondemand' cpufreqpolicy on Kubuntu11.04, I tried the commands 'sudo cpufreq-set -c 0 -g ondemand -d 1000MHz -u 1.83GHz' and similarly for other core. When I typed cpufreq-info -- it stays the same (pasting it below)

    cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
    Report errors and bugs to cpufreq@vger.kernel.org, please.
    analyzing CPU 0:
    driver: acpi-cpufreq
    CPUs which run at the same hardware frequency: 0 1
    CPUs which need to have their frequency coordinated by software: 0
    maximum transition latency: 10.0 us.
    hardware limits: 1000 MHz - 1.83 GHz
    available frequency steps: 1.83 GHz, 1.33 GHz, 1000 MHz
    available cpufreq governors: conservative, ondemand, userspace, powersave, performance
    current policy: frequency should be within 1000 MHz and 1000 MHz.
    The governor "ondemand" may decide which speed to use
    within this range.
    current CPU frequency is 1000 MHz.
    cpufreq stats: 1.83 GHz:0.00%, 1.33 GHz:0.00%, 1000 MHz:100.00%
    analyzing CPU 1:
    driver: acpi-cpufreq
    CPUs which run at the same hardware frequency: 0 1
    CPUs which need to have their frequency coordinated by software: 1
    maximum transition latency: 10.0 us.
    hardware limits: 1000 MHz - 1.83 GHz
    available frequency steps: 1.83 GHz, 1.33 GHz, 1000 MHz
    available cpufreq governors: conservative, ondemand, userspace, powersave, performance
    current policy: frequency should be within 1000 MHz and 1000 MHz.
    The governor "ondemand" may decide which speed to use
    within this range.
    current CPU frequency is 1000 MHz.
    cpufreq stats: 1.83 GHz:0.00%, 1.33 GHz:0.00%, 1000 MHz:100.00%
    Secifically, current policy: frequency should be within 1000 MHz and 1000 MHz.
    The governor "ondemand" may decide which speed to use
    within this range.

    Any help/suggestions? Thanks!

    #2
    Re: Setting correct ondemand cpu governor policy

    Read here for setting cpu freq in KDE http://kubuntuforums.net/forums/inde...opic=3113359.0 This will not survive a reboot, so you will have to create a bash script to run at boot to set it if you want this to be permanent. What is the output of
    Code:
    sudo cat /proc/cpuinfo
    from a terminal? You can look at the "cpu MHz" to see what speed it is currently running at.
    Klaatu Barada Nikto

    Comment


      #3
      Re: Setting correct ondemand cpu governor policy

      Thanks 67GTA for the response! The output is:

      processor : 0
      vendor_id : GenuineIntel
      cpu family : 6
      model : 15
      model name : Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz
      stepping : 6
      cpu MHz : 1000.000
      cache size : 2048 KB
      physical id : 0
      siblings : 2
      core id : 0
      cpu cores : 2
      apicid : 0
      initial apicid : 0
      fdiv_bug : no
      hlt_bug : no
      f00f_bug : no
      coma_bug : no
      fpu : yes
      fpu_exception : yes
      cpuid level : 10
      wp : yes
      flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm dts tpr_shadow
      bogomips : 3657.22
      clflush size : 64
      cache_alignment : 64
      address sizes : 36 bits physical, 48 bits virtual
      power management:

      processor : 1
      vendor_id : GenuineIntel
      cpu family : 6
      model : 15
      model name : Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz
      stepping : 6
      cpu MHz : 1000.000
      cache size : 2048 KB
      physical id : 0
      siblings : 2
      core id : 1
      cpu cores : 2
      apicid : 1
      initial apicid : 1
      fdiv_bug : no
      hlt_bug : no
      f00f_bug : no
      coma_bug : no
      fpu : yes
      fpu_exception : yes
      cpuid level : 10
      wp : yes
      flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm dts tpr_shadow
      bogomips : 3656.36
      clflush size : 64
      cache_alignment : 64
      address sizes : 36 bits physical, 48 bits virtual
      power management:

      Comment


        #4
        Re: Setting correct ondemand cpu governor policy

        I read the other thread as well, but I couldn't find and install 'solid-powermanangement'.

        Comment


          #5
          Re: Setting correct ondemand cpu governor policy

          Originally posted by pacific08
          I read the other thread as well, but I couldn't find and install 'solid-powermanangement'.
          It doesn't exist

          What worked for me was installing laptop-mode-tools and editing (as root) /etc/laptop-mode/conf.d/cpufreq.conf like this - I made the changes in red:

          #
          # Configuration file for Laptop Mode Tools module cpufreq.
          #
          # For more information, consult the laptop-mode.conf( 8 ) manual page.
          #

          ################################################## #############################
          # CPU frequency scaling and throttling
          # ------------------------------------
          #
          # Laptop mode tools can automatically adjust your kernel CPU frequency
          # settings. This includes upper and lower limits and scaling governors.
          # There is also support for CPU throttling, on systems that don't support
          # frequency scaling.
          #
          # This feature only works on 2.6 kernels.
          #
          #
          # IMPORTANT: In versions 1.36 and earlier, these settings were included in the
          # main laptop-mode.conf configuration file. If they are still present, they
          # overrule the settings in this file. To fix this, simply delete the settings
          # from the main config file.
          #
          ################################################## #############################

          # Enable debug mode for this module
          # Set to 1 if you want to debug this module
          DEBUG=0

          #
          # Should laptop mode tools control the CPU frequency settings?
          #
          # Set to 0 to disable
          CONTROL_CPU_FREQUENCY="auto"


          #
          # Legal values are "slowest" for the slowest speed that your
          # CPU is able to operate at, "fastest" for the fastest speed,
          # "medium" for some value in the middle, or any value listed in
          # /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
          # The "governor" can be any governor installed on your system, this usually
          # includes "ondemand", "conservative", and "performance". The
          # "IGNORE_NICE_LOAD" setting specifies that background programs that have
          # a low priority ("nice level") should not cause the CPU frequency to
          # be increased. (You generally want this to be enabled in battery mode.)
          #
          BATT_CPU_MAXFREQ=fastest
          BATT_CPU_MINFREQ=slowest
          #BATT_CPU_GOVERNOR=ondemand
          BATT_CPU_GOVERNOR=performance
          BATT_CPU_IGNORE_NICE_LOAD=1
          LM_AC_CPU_MAXFREQ=fastest
          LM_AC_CPU_MINFREQ=slowest
          LM_AC_CPU_GOVERNOR=ondemand
          LM_AC_CPU_IGNORE_NICE_LOAD=1
          NOLM_AC_CPU_MAXFREQ=fastest
          NOLM_AC_CPU_MINFREQ=slowest
          #NOLM_AC_CPU_GOVERNOR=ondemand
          NOLM_AC_CPU_GOVERNOR=performance
          NOLM_AC_CPU_IGNORE_NICE_LOAD=0


          #
          # Should laptop mode tools control the CPU throttling? This is only useful
          # on processors that don't have frequency scaling.
          # (Only works when you have /proc/acpi/processor/CPU*/throttling.)
          #
          # This is only useful on older P4 processors that do not support frequency
          # scaling. On such processors, this is the only way to reduce power consumption
          # but at the cost of higher performance penalty.
          #
          # Enable this only if you have a processor that does not support frequency scaling
          # On most new processors, you might want to disable it.
          #
          # Set to 0 to disable.
          CONTROL_CPU_THROTTLING=0


          #
          # Legal values are "maximum" for the maximum (slowest) throttling level,
          # "minimum" for minimum (fastest) throttling level, "medium" for a value
          # somewhere in the middle (this is usually 50% for P4s), or any value listed
          # in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
          # this may be _very_ slow (in fact, with P4s it slows down the processor
          # by a factor 8).
          #
          BATT_CPU_THROTTLING=medium
          LM_AC_CPU_THROTTLING=medium
          NOLM_AC_CPU_THROTTLING=minimum


          hope this helps -
          we see things not as they are, but as we are.
          -- anais nin

          Comment


            #6
            Re: Setting correct ondemand cpu governor policy

            One note - if your CPU is overclocked you might want to find another way to do this as it will override your clock settings in BIOS :P

            I have a Core i7-920 desktop PC that I'd cranked up to 3.2GHz (stock is 2.66) and it had been running at 1.5GHz because of ondemand power settings. When I installed laptop-mode-tools and set the power management setting to performance it popped back up to 2.66GHz even though the BIOS clock was set to run the CPU at 3.2GHz.

            Still playing with it, but 2.66 is better than 1.5
            we see things not as they are, but as we are.
            -- anais nin

            Comment


              #7
              Re: Setting correct ondemand cpu governor policy

              It looks like solid no longer controls this in 4.6. It seems to lie somewhere between powerdevil and the kernel now. You were actually on the right track to begin with. Judging by your output you are already using the ondemand freq. It is used by default unless your proc isn't seen/configured correctly. The cpufreq output shows
              Code:
              available frequency steps: 1.83 GHz, 1.33 GHz, 1000 MHz
              It should stay at the lowest speed (1000 MHz) until you need the boost up to the highest (1830 MHz).
              Klaatu Barada Nikto

              Comment


                #8
                Re: Setting correct ondemand cpu governor policy

                It should stay at the lowest but the policy has both upper and lower limit as 1000MHz. I tried changing it through cpufreq-set but didn't work and stays at 1000MHz even if I am doing heavy computing.

                Code:
                current policy: frequency should be within 1000 MHz and 1000 MHz.
                         The governor "ondemand" may decide which speed to use
                         within this range.

                Comment


                  #9
                  Re: Setting correct ondemand cpu governor policy

                  Originally posted by wizard10000
                  What worked for me was installing laptop-mode-tools and editing (as root) /etc/laptop-mode/conf.d/cpufreq.conf like this - I made the changes in red:

                  #BATT_CPU_GOVERNOR=ondemand
                  BATT_CPU_GOVERNOR=performance
                  ...
                  #NOLM_AC_CPU_GOVERNOR=ondemand
                  NOLM_AC_CPU_GOVERNOR=performance
                  I made these changes, still no luck

                  Comment


                    #10
                    Re: Setting correct ondemand cpu governor policy

                    After some more looking -- I found out that the bios_limit is 1000MHz. My battery is old and doesn't stay charged up very well. Could battery be the reason for bios not detecting the correct cpufreq and in turn bios_limit could be the reason for cpu governor not to function properly?

                    Code:
                    $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 
                    1833000
                    $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq 
                    1000000
                    $ cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit 
                    1000000

                    Comment


                      #11
                      Re: Setting correct ondemand cpu governor policy

                      This appears to be a kernel bug - check it out:

                      https://lkml.org/lkml/2011/7/21/372

                      http://www.spinics.net/lists/cpufreq/msg01694.html

                      Apparently bios_limit is indeed what's holding you back.
                      we see things not as they are, but as we are.
                      -- anais nin

                      Comment


                        #12
                        Re: Setting correct ondemand cpu governor policy

                        Thanks! What is the best way to fix this? I have very little experience with kernel compiling.

                        Comment


                          #13
                          Re: Setting correct ondemand cpu governor policy

                          Your best bet might be to live with it until the next kernel's released - or roll back to an earlier kernel.
                          we see things not as they are, but as we are.
                          -- anais nin

                          Comment


                            #14
                            Re: Setting correct ondemand cpu governor policy

                            Found the solution.

                            https://wiki.archlinux.org/index.php...quency_Scaling

                            we see things not as they are, but as we are.
                            -- anais nin

                            Comment

                            Working...
                            X