Announcement

Collapse
No announcement yet.

Ondemand vs. Performance CPU Governing For AMD FX CPUs On Linux 3.17

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ondemand vs. Performance CPU Governing For AMD FX CPUs On Linux 3.17

    Phoronix: Ondemand vs. Performance CPU Governing For AMD FX CPUs On Linux 3.17

    Given recent comments by Phoronix readers, here are some fresh results from the AMD FX-9590 Eight-Core CPU when testing the different CPU scaling governors with the CPUfreq driver on the Linux 3.17 kernel.

    http://www.phoronix.com/vr.php?view=20839

  • #2
    What happens if you change cpufreq's up_threshold to something lower than 95%?

    Try:
    # echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
    (Sets cpufreq to scale higher when load hits 50%)
    # echo 100 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 50
    (Reduces frequency of the "Do I need to scale back down?" question at higher clocks)

    More reading: https://www.kernel.org/doc/Documenta.../governors.txt

    Comment


    • #3
      Originally posted by A Laggy Grunt View Post
      What happens if you change cpufreq's up_threshold to something lower than 95%?

      Try:
      # echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
      (Sets cpufreq to scale higher when load hits 50%)
      # echo 100 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 50
      (Reduces frequency of the "Do I need to scale back down?" question at higher clocks)

      More reading: https://www.kernel.org/doc/Documenta.../governors.txt
      +1

      I found even:
      echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
      echo 100 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
      provided me with rather noticeable performance improvements (especially browser smoothness)

      Comment


      • #4
        Originally posted by grigi View Post
        +1

        I found even:
        echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
        echo 100 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
        provided me with rather noticeable performance improvements (especially browser smoothness)
        I have been doing the same for a while now. The default values give good power savings on laptops, but for desktops is this not really critical and one can increase its aggressiveness a notch. I use the sysfs tools for it and added it into my /etc/sysfs.conf file:

        Code:
        # set ondemand CPU governor to switch up at 50% load and stay up 10x longer
        devices/system/cpu/cpufreq/ondemand/up_threshold = 50
        devices/system/cpu/cpufreq/ondemand/sampling_down_factor = 10
        
        devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
        devices/system/cpu/cpu1/cpufreq/scaling_governor = ondemand
        devices/system/cpu/cpu2/cpufreq/scaling_governor = ondemand
        devices/system/cpu/cpu3/cpufreq/scaling_governor = ondemand
        
        # enable power saving on SATA links
        class/scsi_host/host0/link_power_management_policy = min_power
        class/scsi_host/host1/link_power_management_policy = min_power
        class/scsi_host/host2/link_power_management_policy = min_power
        class/scsi_host/host3/link_power_management_policy = min_power
        
        # Seagate ST1000DM003-1CH162
        # set scheduler and KB size for read-ahead operations
        block/sda/queue/scheduler = cfq
        block/sda/queue/read_ahead_kb = 1024
        
        # INTEL SSDSA2MH080G1GC
        # set scheduler and KB size for read-ahead operations
        block/sdb/queue/scheduler = deadline
        block/sda/queue/read_ahead_kb = 256
        This is an example. One can tweak other settings with it as well as you can see here.

        Comment


        • #5
          I am using those values on a notebook, and have noticed no impact on battery life at all :-)

          Comment


          • #6
            Originally posted by sdack View Post
            I have been doing the same for a while now. The default values give good power savings on laptops, but for desktops is this not really critical and one can increase its aggressiveness a notch. I use the sysfs tools for it and added it into my /etc/sysfs.conf file:

            Code:
            # set ondemand CPU governor to switch up at 50% load and stay up 10x longer
            devices/system/cpu/cpufreq/ondemand/up_threshold = 50
            devices/system/cpu/cpufreq/ondemand/sampling_down_factor = 10
            
            devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
            devices/system/cpu/cpu1/cpufreq/scaling_governor = ondemand
            devices/system/cpu/cpu2/cpufreq/scaling_governor = ondemand
            devices/system/cpu/cpu3/cpufreq/scaling_governor = ondemand
            
            # enable power saving on SATA links
            class/scsi_host/host0/link_power_management_policy = min_power
            class/scsi_host/host1/link_power_management_policy = min_power
            class/scsi_host/host2/link_power_management_policy = min_power
            class/scsi_host/host3/link_power_management_policy = min_power
            
            # Seagate ST1000DM003-1CH162
            # set scheduler and KB size for read-ahead operations
            block/sda/queue/scheduler = cfq
            block/sda/queue/read_ahead_kb = 1024
            
            # INTEL SSDSA2MH080G1GC
            # set scheduler and KB size for read-ahead operations
            block/sdb/queue/scheduler = deadline
            block/sda/queue/read_ahead_kb = 256
            This is an example. One can tweak other settings with it as well as you can see here.
            is this also advisable for old intel core2quad cpus? Or only amd?

            Comment


            • #7
              Originally posted by tomtomme View Post
              is this also advisable for old intel core2quad cpus? Or only amd?
              This is for any system that uses ondemand, which is anything from Intel, AMD, ARM, etc... Very likely your Core2, yes.

              Comment


              • #8
                Only Intel SandyBridge+ are special and uses pstate, if you have any other processor from pretty much any other vendor you can use this .

                Comment


                • #9
                  Please see this

                  You must measure your values individually! But the culprit is that "Active" task on server and on desktop are different things!
                  On Desktop, *any* task that is not idling task, should already wake CPU.
                  Last edited by brosis; 09-02-2014, 06:51 AM.

                  Comment


                  • #10
                    Originally posted by grigi View Post
                    +1

                    I found even:
                    echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
                    echo 100 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
                    provided me with rather noticeable performance improvements (especially browser smoothness)
                    Do I have to restart the PC or is it applied immediately?

                    Comment


                    • #11
                      Originally posted by tomtomme View Post
                      Do I have to restart the PC or is it applied immediately?
                      Immediately.

                      it doesn't persist across boots, so you should put it in a startup script to run after every boot (very much distro-dependant)

                      Comment


                      • #12
                        Originally posted by grigi View Post
                        Immediately.

                        it doesn't persist across boots, so you should put it in a startup script to run after every boot (very much distro-dependant)
                        thanks!
                        did some testing with the witcher 2 port and it helped!

                        Comment


                        • #13
                          Did you try and post images? I have some png file names in the email.

                          Comment


                          • #14
                            Originally posted by grigi View Post
                            Did you try and post images? I have some png file names in the email.
                            default settings 95 and 1


                            15 and 100



                            HD 7950 core2quat @ 3ghz
                            radeonSI, Mesa 10.4, llvm3.6svn, hyperz, kernel 3.16.1
                            FPS graphs / screenshots from GALLUM_HUD after easy arena fight in the witcher 2 beta 5;
                            low settings, GL 3.2, 1080p, vsync
                            Last edited by tomtomme; 09-03-2014, 05:06 AM.

                            Comment


                            • #15
                              Iíve also been using up_threshold = 50 and sampling_down_factor = 10 for a long time on my Core i3*. It used to make Flash behave correctly several years ago, and recently Iíve also seen that it makes ondemand very close to performance in terms of FPS for The Witcher 2, while the default 95/1 makes you lose 5-10% in FPS.
                              [*] First gen Core i processors do not use intel_pstate.

                              Comment

                              Working...
                              X