1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

CPUFreq Ondemand Could Be Faster, Use Less Power With Linux 3.17

Linux Kernel

Published on 22 July 2014 08:11 PM EDT
Written by Michael Larabel in Linux Kernel
14 Comments

Improvements to the CPUfreq ondemand governor could lead to faster performance in low to medium workloads with the Linux 3.17 kernel while also consuming less power overall.

Queued up today for merging into the Linux 3.17 kernel in a few weeks time are two patches that for the CPUfreq driver's ondemand governor will eliminate a "deadband effect" in low workloads. Stratos Karafotis -- the author of these patches -- explained, "This patchset changes slightly the calculation of target frequency to eliminate the deadband effect (explained in patch 2 changelog) that it seems to slow down the CPU in low and medium loads."

Tests were done by the developer of the patches and the benchmarks were carried out with the Phoronix Test Suite on an Intel Core i7 machine. With workloads ranging from the Linux kernel compilation to Apache to FFmpeg the energy savings were up to 4% while the performance was up to 6% faster with CPUfreq ondemand. Those details can be found in this mailing list post.

Rafael J. Wysocki, the Intel employee that serves as the ACPI/PM subsystem maintainer for the Linux kernel, queued the patches today for merging into Linux 3.17. Below is the patch message that describes this CPUfreq ondemand change for eliminating the deadband effect.
Currently, ondemand calculates the target frequency proportional to load using the formula:

Target frequency = C * load
where C = policy->cpuinfo.max_freq / 100

Though, in many cases, the minimum available frequency is pretty high and the above calculation introduces a dead band from load 0 to 100 * policy->cpuinfo.min_freq / policy->cpuinfo.max_freq where the target frequency is always calculated to less than policy->cpuinfo.min_freq and the minimum frequency is selected.

For example: on Intel i7-3770 @ 3.4GHz the policy->cpuinfo.min_freq = 1600000 and the policy->cpuinfo.max_freq = 3400000 (without turbo). Thus, the CPU starts to scale up at a load above 47. On quad core 1500MHz Krait the policy->cpuinfo.min_freq = 384000 and the policy->cpuinfo.max_freq = 1512000. Thus, the CPU starts to scale at load above 25.

Change the calculation of target frequency to eliminate the above effect using the formula:

Target frequency = A + B * load
where A = policy->cpuinfo.min_freq and
B = (policy->cpuinfo.max_freq - policy->cpuinfo->min_freq) / 100

This will map load values 0 to 100 linearly to cpuinfo.min_freq to cpuinfo.max_freq.

Also, use the CPUFREQ_RELATION_C in __cpufreq_driver_target to select the closest frequency in frequency_table. This is necessary to avoid selection of minimum frequency only when load equals to 0. It will also help for selection of frequencies using a more 'fair' criterion.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. A Walkthrough Of The New 32 System Open-Source Linux Benchmarking Test Farm
  2. Habey MITX-6771: Mini-ITX Board With Quad-Core J1900 Bay Trail
  3. OCZ Vector 150 SSD On Linux
  4. Noctua i4 CPU Cooler: Great For Cooling High-End LGA-2011v3 CPUs
Latest Linux Articles
  1. AMD Kaveri: Open-Source Radeon Gallium3D vs. Catalyst 14.12 Omega Driver
  2. 12-Way AMD Catalyst 14.12 vs. NVIDIA 346 Series Linux GPU Comparison
  3. AMD Catalyst 14.12 Omega Driver Brings Mixed Results For Linux Users
  4. 6-Way Winter 2014 Linux Distribution Comparison
Latest Linux News
  1. Civilization: Beyond Earth Launches For Linux
  2. NIR Has Been Revised As A New IR For Mesa
  3. New 64-bit Linux Kernel Vulnerabilities Disclosed This Week
  4. PostgreSQL 9.4 Brings JSONB & Many Other New Features
  5. That Nasty Linux Kernel Lockup Bug Is Still Unresolved
  6. KDE's Krita Loses Its Main Backer
  7. Inline Data Support Comes To CephFS With Linux 3.19
  8. VC4 Gallium3D Adds DMA-BUF Support, Yields Working DRI3
  9. GNOME Builder Is Still Building Up To A New IDE For Developers
  10. Raspberry Pi's Gallium3D Driver Could Now Run Significantly Faster
Latest Forum Discussions
  1. Bench specific mount point
  2. XLennart: A Game For Systemd Haters With Nothing Better To Do
  3. Tool for measuring FPS in games
  4. Need some hand holding with upgrading xserver
  5. Ubuntu Developers Still Thinking What To Do About Adobe Flash Support
  6. Microsoft buying Mojang
  7. Updated and Optimized Ubuntu Free Graphics Drivers
  8. Premium subscription "login" times out much faster than forum