CPU Power Management

I have just installed IPFire and it is running as a machine on my LAN as I am learning it. I have noticed the fan running on the CPU constantly whereas I don’t seem to remember the fan continually running when the PC was running Windows.

I’ve had a look at the values in /sys/devices/system/cpu/cpufreq/policyX and it seems scaling_governor is set to performance and scaling_cur_freq is running at the maximum 2900000.

The processor is an Intel Core i3-4130T.

What is the recommended way to manage power on the CPU? I don’t see that it should be running flat out when effectively doing nothing.

Try installing the addon “cpufrequtils” and rebooting. It should reduce CPU frequency, but might give error messages if your UEFI needs upgrading.

1 Like

I did that and the governor changed to ondemand.

There is a bug in that if you use the command cpufreq-set -g schedutil it only does it for policy0 and not all policies. To do it for policy 1 you have to add the switch -c 1.

The ondemand governor does not seem to be any better than the schedutil governor that was already available but not used, but I had been trying out.

During boot up I gained a couple of errors about the schedutil driver not being available. Presumably it was still booting with schedutil and then switching to ondemand?

I then removed cpufrequtils and it reverted to using performance. It looks like I need to set it to schedutil every time or leave in cpufrequtils.

How do you set something to run on boot?

I’ve tried adding:

/usr/bin/echo schedutil  > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
/usr/bin/echo schedutil  > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor

to rc.local but it does nothing. I see in the messages log:

Feb 16 11:42:50 ipfire collectd[2526]: cpufreq: fgets: Device or resource busy
Feb 16 11:42:50 ipfire collectd[2526]: read-function of plugin `cpufreq' failed. Will suspend it for 120 seconds.
Feb 16 11:44:50 ipfire collectd[2526]: cpufreq: fgets: Device or resource busy
Feb 16 11:44:50 ipfire collectd[2526]: read-function of plugin `cpufreq' failed. Will suspend it for 240 seconds.

I don’t know if this is relevant. At which point during the boot does rc.local run?

My bad. The executable is /bin/echo and not /usr/bin/echo. I have it working from rc.local. The messages still appear in /var/log/messages, so probably have nothing to do with setting the parameter.

I’ve not attempted to tune cpufreq. Simply having cpufrequtils installed gets my systems running all cores at close to minumum most of the time. That is on AMD APU. YMMV with Intel CPU.

The issue is discussed in one current thread: https://community.ipfire.org/t/ipfire-2-29-x86-64-core183-issue-w-cpufreq/11090/17

as well as several earlier threads that you could search.

One of the threads said cpufrequtils hadn’t been updated for 9 years so I was trying to find out how to get the power savings without it.

Several contributors have experimented with deleting cpufrequtils and found that power savings don’t work without it, period, at least not on AMD CPU.

1 Like

Interesting. My cpu is Intel and the schedutil driver seems to hand off to the p-state kernel code OK - or at least I assume it does because when I activate it, my CPU speed immediately drops from 2900MHz to 800MHz and then it varies from then upwards.

Unfortunately the System CPU graph is broken and never displays anything so I can show it. I can only see it by querying the cpu speed directly from /sys/devices/system/cpu/cpufreq/policyX/. Now, if anyone could help me fix the graph, I’d appreciate it.