cpufreq ondemand governor stuck at lowest frequency

Bug #367739 reported by Steve Lacy on 2009-04-27
66
This bug affects 10 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: linux-image-2.6.28-11-generic

Upon booting 9.04 Jaunty on my netbook (Intel Atom N270 @ 1.66GHz) the system is using the ondemand governor, and is running at 800Mhz. There's virtually nothing I can do to the system to get it to use a faster frequency. Setting the governor to "performance" makes it got to 1.6GHz.

I've written a small "while(1) i++;" program to load down both virtual cores (hyperthreaded) and even under 100% load on both cores, it still sticks at 800MHz.

I'm on battery power 100% of the time, including the initial boot. I haven't checked to see if there's anything different if under AC power, but can do so if you think it would effect this.

$ uname -a
Linux slacy-laptop 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
HibernationDevice: RESUME=UUID=473c5a8e-df00-43b5-96d2-5cbbfdcc5f3e
MachineType: LENOVO Lenovo
Package: linux-image-2.6.28-11-generic 2.6.28-11.42
ProcCmdLine: root=UUID=1e0472b8-386f-467a-b19a-f24196576af7 ro quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.28-11.42-generic
SourcePackage: linux

$ pwd
/sys/devices/system/cpu/cpu0/cpufreq

$ sudo grep "." *
affected_cpus:0
cpuinfo_cur_freq:1600000
cpuinfo_max_freq:1600000
cpuinfo_min_freq:800000
related_cpus:0 1
scaling_available_frequencies:1600000 1333000 1067000 800000
scaling_available_governors:conservative ondemand userspace powersave performance
scaling_cur_freq:1600000
scaling_driver:acpi-cpufreq
scaling_governor:performance
scaling_max_freq:1600000
scaling_min_freq:800000
scaling_setspeed:<unsupported>

Jay Modi (jaymode) wrote :

I am also seeing the same issue but on different hardware and the x86_64 version of 9.04.

My hardware is:
Abit AB9 Pro Motherboard
4GB DDR-2 800
Intel Pentium Dual Core E2180

CPU0 will not scale, but CPU1 will scale.

/sys/devices/system/cpu/cpu0/cpufreq$ sudo grep "." *
affected_cpus:0
cpuinfo_cur_freq:2750000
cpuinfo_max_freq:2750000
cpuinfo_min_freq:1650000
related_cpus:0
scaling_available_frequencies:2750000 2200000 1650000
scaling_available_governors:conservative ondemand userspace powersave performance
scaling_cur_freq:1650000
scaling_driver:acpi-cpufreq
scaling_governor:performance
scaling_max_freq:1650000
scaling_min_freq:1650000
scaling_setspeed:<unsupported>

/sys/devices/system/cpu/cpu0/cpufreq$ cpufreq-info
cpufrequtils 004: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to <email address hidden>, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which need to switch frequency at the same time: 0
  hardware limits: 1.65 GHz - 2.75 GHz
  available frequency steps: 2.75 GHz, 2.20 GHz, 1.65 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 1.65 GHz and 1.65 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.65 GHz.
  cpufreq stats: 2.75 GHz:0.49%, 2.20 GHz:0.66%, 1.65 GHz:98.85% (5)
analyzing CPU 1:
  driver: acpi-cpufreq
  CPUs which need to switch frequency at the same time: 1
  hardware limits: 1.65 GHz - 2.75 GHz
  available frequency steps: 2.75 GHz, 2.20 GHz, 1.65 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 1.65 GHz and 2.75 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.65 GHz.
  cpufreq stats: 2.75 GHz:15.31%, 2.20 GHz:0.06%, 1.65 GHz:84.63% (123)

Adding more details here:

- CPU frequency scaling is stuck at lowest frequency upon first cold boot when on battery power.
- Subsequent resume from suspend under battery power, and cpufreq scaling works properly.
- Cold booting while on A/C power results in proper scaling from boot.

I have the same issue with Linux Mint 7 Gloria (based on Ubuntu 9.04) and the same 2.6.28 kernel on an Aspire One 150L (Atom N270 CPU). I used Mint 6 before, with kernel 2.6.24, and the "ondemand" governor used to scale propertly.

$ uname -a
Linux adrastea 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

$ inxi -F -c0
System: Host adrastea Kernel 2.6.28-11-generic i686 (32 bit) Distro Linux Mint 7 Gloria - Main Edition
CPU: Single core Intel Atom N270 (HT) cache 512 KB flags (sse3) bmips 3192.54
           Clock Speeds: (1) 800.00 MHz (2) 1600.00 MHz
Graphics: Card Intel Mobile 945GME Express Integrated Graphics Controller X.Org 1.6.0 Res 1024x600@60.0hz
Audio: Card Intel 82801G (ICH7 Family) High Definition Audio Controller driver HDA Intel
           Sound: Advanced Linux Sound Architecture Version 1.0.18rc3
Network: Card-1 Realtek RTL8101E/RTL8102E PCI Express Fast Ethernet controller driver r8169 v: 2.3LK-NAPI at port 3000
           Card-2 Atheros AR242x 802.11abg Wireless PCI Express Adapter driver ath5k v: 0.6.0
Disks: HDD Total Size: 120.0GB (22.1% used) 1: /dev/sda Hitachi HTS54321 120.0GB
Partition: ID:/ size: 22G used: 4.7G (23%) ID:/home size: 79G used: 21G (27%) ID:swap-1 size: 1.61GB used: 0.00GB (0%)
Info: Processes 135 Uptime 22:50 Memory 239.7/1496.6MB Client Shell inxi 1.0.6

$ cd /sys/devices/system/cpu/cpu0/cpufreq
/sys/devices/system/cpu/cpu0/cpufreq$ sudo grep "." *
affected_cpus:0
cpuinfo_cur_freq:800000
cpuinfo_max_freq:1600000
cpuinfo_min_freq:800000
related_cpus:0 1
scaling_available_frequencies:1600000 1333000 1066000 800000
scaling_available_governors:conservative ondemand userspace powersave performance
scaling_cur_freq:800000
scaling_driver:acpi-cpufreq
scaling_governor:ondemand
scaling_max_freq:1600000
scaling_min_freq:800000
scaling_setspeed:<unsupported>

/sys/devices/system/cpu/cpu0/cpufreq$ sudo grep "." ondemand/*
ondemand/ignore_nice_load:0
ondemand/powersave_bias:0
ondemand/sampling_rate:80000
ondemand/sampling_rate_max:40000000
ondemand/sampling_rate_min:40000
ondemand/up_threshold:95

Jeremy Foshee (jeremyfoshee) wrote :

Hi Steve,

This bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/lucid.

If it remains an issue, could you run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux 367739

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: needs-kernel-logs
tags: added: needs-upstream-testing
tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete

Jeremy: The bug was still present on the new kernels last time I checked it. Though it is easy to solve, if you know what are you looking for.

Last times I installed an Ubuntu or Mint machine (Core2Duos and Atoms), I had to cope with it: The CPU will remain at the lowest frequency most of the time. On the Atom it even causes stuttering on CPU-demanding applications (like Flash, or Compiz efects).

I think that the root of the problem maybe the threshold that is used to increase the CPU speed: It's too hight!
If I remember correctly it is 90%. The problem is, that with mostly-single-threaded apps, even if one thread is running at 100% is hard to achieve a 90% CPU usage on *both* cores (it just gets balanced, so you get something like 60% and 40% load on each core).
That seems to be the problem: Most of the applications use the full juice of a single thread, but don't get to use neither core at 90% (on the hyper-threaded Atoms this seems to be true for almost every CPU load), and the CPU doesn't scale up on these cases.

So the easy workaround is just to lower the threshold below 50%, so that one thread running at 100% is enough to scale up the speed. This is really noticeable on Atoms (600Mhz -> 1200Mhz, twice as fast when it scales up!) and greatly reduces problems with Flash (let's say Youtube) and makes Compiz smoother. The workaround just consists on 3 lines on the "/etc/rc.local" file:

sleep 30 # Wait for the ondemand governor to be fully load
echo 25 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 25 > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold

Anyway, I think the problem should be solved either at Ubuntu: The default threshould should be configured to <50%. Even if this reduces a bit the battery life (as I say on Atoms it may be a night and day difference).
Or at the kernel (the cpu governor) level: The governor should take into account the load balancing the kernel seems to be doing between cores. Seems hard for a single threaded app to use the 90% of a single core.

Ryan Thompson (rct86) wrote :

I had this problem, and I eventually fixed it by loading the coretemp kernel module. I think. It might have been a coincidence, or my imagination. Anyway, other people can try this and see if it works.

Jeremy Foshee (jeremyfoshee) wrote :

This bug report was marked as Incomplete and has not had any updated comments for quite some time. As a result this bug is being closed. Please reopen if this is still an issue in the current Ubuntu release http://www.ubuntu.com/getubuntu/download . Also, please be sure to provide any requested information that may have been missing. To reopen the bug, click on the current status under the Status column and change the status back to "New". Thanks.

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kj-expired
Changed in linux (Ubuntu):
status: Incomplete → Expired

This bug (may) also be present on the HP Mini 311-1037nr (Intel Atom N270 @ 1.6 GHz) I am using the current updated version of Ubuntu 10.04 LTS. I seem to have problems setting the CPU Frequency scaling with the "CPU Frequency Scaling Monitor" on the panel. It lists: 800 MHz, 1.07 GHz, 1.33 GHz, 1.60 GHz. I have tried many times to set it to 1.60 GHz, but it will only stay at 800 MHz. There is a considerable speed DECREASE when using Ubuntu vs. Windows 7. I hate windows, so I find it hard to just switch to crap, so I have been trying my hardest to fix this problem. I am sorry if I wasn't supposed to comment on here since the bug has "expired", but I am desperate for a fix.

Martin Scherer (marscher) wrote :

This bug is still present in 11.04 amd64 and kernel 2.6.38-10-generic.

CPU is Intel(R) Core(TM) i5 CPU M 520

Changed in linux (Ubuntu):
status: Expired → New
tags: added: apport-collected natty

AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.23.
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: marscher 694 F.... pulseaudio
CRDA:
 country DE:
  (2400 - 2483 @ 40), (N/A, 20)
  (5150 - 5250 @ 40), (N/A, 20), NO-OUTDOOR
  (5250 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
  (5470 - 5725 @ 40), (N/A, 26), DFS
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xf2520000 irq 44'
   Mixer name : 'Intel IbexPeak HDMI'
   Components : 'HDA:14f15069,17aa21a4,00100302 HDA:80862804,17aa21b5,00100000'
   Controls : 13
   Simple ctrls : 7
Card29.Amixer.info:
 Card hw:29 'ThinkPadEC'/'ThinkPad Console Audio Control at EC reg 0x30, fw 6UHT32WW-1.13'
   Mixer name : 'ThinkPad EC 6UHT32WW-1.13'
   Components : ''
   Controls : 1
   Simple ctrls : 1
Card29.Amixer.values:
 Simple mixer control 'Console',0
   Capabilities: pswitch pswitch-joined penum
   Playback channels: Mono
   Mono: Playback [off]
DistroRelease: Ubuntu 11.04
HibernationDevice: RESUME=UUID=bae3081f-ce14-47b2-8233-b749e86eb658
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
MachineType: LENOVO 2912W1C
Package: linux (not installed)
ProcEnviron:
 LANGUAGE=de_DE:en
 PATH=(custom, no user)
 LANG=de_DE.UTF-8
 SHELL=/bin/zsh
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-10-generic root=UUID=b545759a-c92e-4838-806b-da7044ac5e31 ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 2.6.38-10.46-generic 2.6.38.7
RelatedPackageVersions:
 linux-restricted-modules-2.6.38-10-generic N/A
 linux-backports-modules-2.6.38-10-generic N/A
 linux-firmware 1.52
Tags: natty
Uname: Linux 2.6.38-10-generic x86_64
UpgradeStatus: Upgraded to natty on 2011-05-02 (102 days ago)
UserGroups: adm admin cdrom dialout disk kismet kvm lpadmin plugdev powerdev sambashare vboxusers
dmi.bios.date: 05/10/2011
dmi.bios.vendor: LENOVO
dmi.bios.version: 6UET64WW (1.44 )
dmi.board.name: 2912W1C
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr6UET64WW(1.44):bd05/10/2011:svnLENOVO:pn2912W1C:pvrThinkPadT410s:rvnLENOVO:rn2912W1C:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 2912W1C
dmi.product.version: ThinkPad T410s
dmi.sys.vendor: LENOVO

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Brad Figg (brad-figg) on 2011-08-15
Changed in linux (Ubuntu):
status: New → Confirmed
tags: added: jaunty
tags: removed: natty

Steve Lacy, thank you for reporting this and helping make Ubuntu better. Jaunty reached EOL on October 23, 2010.
Please see this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We were wondering if this is still an issue in a supported release? If so, can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command in a supported release from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux <replace-with-bug-number>

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.

Please let us know your results. Thanks in advance.

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers