Bug#273041: gnome-cpufreq-applet: fails to notice CPU speed change

Marius Gedminas Marius Gedminas <mgedmin@b4net.lt>, 273041@bugs.debian.org
Thu, 23 Sep 2004 19:00:29 +0300


I have downloaded the source code and looked into it.  The applet has
three methods for determining the CPU frequency:

  1. from /proc/cpufreq
  2. from /proc/cpuinfo
  3. from /sys/devices/system/cpu/cpu[0]/cpufreq/*

I have a 2.4 kernel without sysfs, therefore the third method is
irrelevant.  The second method would produce correct result -- the CPU
frequency in /proc/cpuinfo changes when I change the CPU speed.

Apparently the applet uses the first method, which is not very reliable.
In my case /proc/cpufreq shows the same thing no matter what CPU speed
I select:

            minimum CPU frequency  -  maximum CPU frequency  -  policy
  CPU  0       665000 kHz ( 76 %)  -     864500 kHz (100 %)  -  userspace

The cpufreq applet assumes that policy == "poversave" implies the minimum
CPU frequency, and all other policies imply the maximum CPU frequency.
This is demonstrably wrong.  The applet should treat "userspace" policy
as unknown and fall back to other means of determining the CPU
frequency, e.g. /proc/cpuinfo.

There is another way of detecting the CPU speed:

  $ cat /proc/sys/cpu/0/speed
  665000

I do not know if it is used by any released kernel.  It is used by the
CPUfreq patch for 2.4 kernels.

FWIF I use a 2.4.26 kernel with cpufreq-LINUX_2_4-20040623.tar.gz
applied.  I got the patch from

  http://ftp.linux.org.uk/pub/linux/cpufreq/

Marius Gedminas
-- 
"I'll be Bach."  -- Johann Sebastian Schwarzenegger