LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-02-2015, 12:09 PM   #1
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
What's keeping my CPU from scaling down?


My install is about 5 years old, and has been through a few CPUs (previously i7-2600k and Phenom II X4 965 BE). I currently have an i7-4790K. I've noticed that the CPU rarely scales down below 4000MHz. It ranges from 4800MHz to 800MHz. It should scale down to about 800MHz when idle.

The running kernel:
Code:
# uname -a
Linux siduxion 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt4-3 (2015-02-03) x86_64 GNU/Linux
Both my system and LM17.1 have the same cpu related packages installed
Code:
# dpkg --get-selections | grep -i cpu
cpufrequtils                                    install
libcpufreq0                                     install
This is a screenshot from Linux Mint 17.1 LiveCD with i7z (0.27.2+git2013.10.12-g5023138-2).




This is from my install, same i7z.




Top doesn't show any significant CPU usage preventing the CPU from scaling.
 
Old 03-02-2015, 12:29 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
The default governor for CPUfreq is "performance" which will only slow your CPUs when they are on fire. Change to "ondemand" if you want low power when idle and max performance under load.
 
1 members found this post helpful.
Old 03-02-2015, 12:54 PM   #3
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126

Original Poster
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by smallpond View Post
The default governor for CPUfreq is "performance" which will only slow your CPUs when they are on fire. Change to "ondemand" if you want low power when idle and max performance under load.
Code:
# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 800 MHz - 4.80 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 800 MHz and 4.80 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 4.47 GHz (asserted by call to hardware).
I don't have the ondemand governor. Only performance and powersave. Even with powersave, it stays the same.
 
Old 03-02-2015, 01:29 PM   #4
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Firefox is the most likely culprit.
 
Old 03-02-2015, 01:37 PM   #5
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126

Original Poster
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by metaschima View Post
Firefox is the most likely culprit.
Nope. Stays the same, even without X running.

Also, I believe cpufreq has no control of the intel_pstate driver.
 
Old 03-02-2015, 01:48 PM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Try to throw out cpufrequtils (it is deprecated anyways) and replace it with cpupower, see if that works.
Which governors are available depends on your kernel configuration, check if the ondemand governor is available there.
 
Old 03-02-2015, 03:26 PM   #7
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by replica9000 View Post
Nope. Stays the same, even without X running.

Also, I believe cpufreq has no control of the intel_pstate driver.
I recommend disabling the Intel Pstate driver and instead using:
CONFIG_X86_ACPI_CPUFREQ

I also recommend the ondemand governor for desktop systems.
 
Old 03-03-2015, 01:52 AM   #8
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126

Original Poster
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
I didn't realize Linux Mint was using the acpi-cpufreq driver by default. cpupower seems to be able to control that driver, whereas the intel_pstate driver seems to ignore any changes made by cpupower.

The downside to the acpi-cpufreq driver is that /proc/cpuinfo doesn't show the turbo frequencies.
 
Old 03-07-2015, 07:00 AM   #9
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Try cpufreq-aperf.
Code:
sudo modprobe msr
sudo cpufreq-aperf
 
Old 03-07-2015, 03:29 PM   #10
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126

Original Poster
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by gradinaruvasile View Post
Try cpufreq-aperf.
Code:
sudo modprobe msr
sudo cpufreq-aperf
Thanks for the info. I had written a script for get the current frequencies. Seems to work alright. I might play with the output of cpufreq-aperf too.

Code:
#!/bin/bash

# Get CPU's max non-turbo frequency
max_freq=$(rdmsr 0xce -f 15:8 -d | awk '{print $1*100,$2}')

socket0_aperf=0
socket0_mperf=0

while true; do

# Get aperf/mperf for all cores
socket0_aperf2=$(rdmsr -a 0xe8 -d 2> /dev/null)
socket0_mperf2=$(rdmsr -a 0xe7 -d 2> /dev/null)

# Calculate difference between aperf/mperf
socket0_aperf_diff=$(paste <(echo "$socket0_aperf2") <(echo "$socket0_aperf") | awk '{print $1-$2,$3}')
socket0_mperf_diff=$(paste <(echo "$socket0_mperf2") <(echo "$socket0_mperf") | awk '{print $1-$2,$3}')

socket0_aperf=$socket0_aperf2
socket0_mperf=$socket0_mperf2

CPUFREQ=$(paste <(echo "$socket0_aperf_diff") <(echo "$socket0_mperf_diff") | awk '{print ($1*'"$max_freq"')/$2,$3}' | awk -F "." '{print $1}' | sed 's/\s*$//g')

# The output
CORE00=$(echo "$CPUFREQ" | head -1); echo "Core 0: $CORE00 MHz"
CORE01=$(echo "$CPUFREQ" | head -2 | tail -1); echo "Core 1: $CORE01 MHz"
CORE02=$(echo "$CPUFREQ" | head -3 | tail -1); echo "Core 2: $CORE02 MHz"
CORE03=$(echo "$CPUFREQ" | head -4 | tail -1); echo "Core 3: $CORE03 MHz"
CORE04=$(echo "$CPUFREQ" | head -4 | tail -1); echo "Core 4: $CORE04 MHz"
CORE05=$(echo "$CPUFREQ" | head -4 | tail -1); echo "Core 5: $CORE05 MHz"
CORE06=$(echo "$CPUFREQ" | head -4 | tail -1); echo "Core 6: $CORE06 MHz"
CORE07=$(echo "$CPUFREQ" | head -4 | tail -1); echo "Core 7: $CORE07 MHz"
echo " "

sleep 1

done

exit

Last edited by replica9000; 03-07-2015 at 03:31 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with CPU scaling iago-x86 Linux - Laptop and Netbook 11 11-19-2009 04:44 PM
cpu frequency scaling with Pentium(R) Dual-Core CPU E5200 @ 2.50GHz tramni1980 Slackware 5 08-16-2009 08:29 AM
CPU Scaling toasty_ghosty Slackware 18 09-20-2007 08:19 PM
Could really use some help understanding CPU Scaling lumix Linux - Laptop and Netbook 2 07-04-2007 10:01 AM
CPU Scaling StevenO General 7 02-15-2006 07:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration