Powertop no longer works

Hello,
Thanks so much for continuing to support Powertop in IPFire!
( Will the Powertop Add-on be available in future updates? )

Unfortunately it is not working in Core Update 173:

# powertop --debug
modprobe cpufreq_stats failedFailed to mount debugfs!
exiting...

Is this something which could be fixed in a future release please?

Thank you!
Save

I have had a look at this.

I confirm getting the same message with CU173 but I also found the same message when I installed CU172 and CU171 into my vm system and ran powertop --debug

Running
modprobe cpufreq_stats
gave the message

modprobe: FATAL: Module cpufreq_stats not found in directory /lib/modules/5.15.59-ipfire

I then installed CU170 and ran Powertop and this time it gave ouput but the first line was still

modprobe cpufreq_stats failed

and running the modprobe cpufreq_stats command still gave the same message.

So the module cpufreq_stats has been missing from the kernel since at least CU170.

Powertop 2.14 in CU170 gave the modprobe failure error but continued running after the error.

From CU171 onwards Powertop gives the modprobe failure error and then stops.

I have checked Powertop on my Arch Linux systems and they have the same modprobe failure error message but continue running.

The version of powertop on Arch Linux was 2.15 while on IPFire it is 2.14

I therefore downgraded the Powertop install on my Arch Linux system to install version 2.14
The same modprobe failure error message still ocurred but modprobe continued running after it.

The build instructions for the Arch Linux powertop program are the same as used in IPFire.

So this problem has been present with Powertop since CU171 but I can not understand why the error message that was present before CU171 stops powertop running from CU171 onwards.

Nothing has been changed in the build of powertop since CU168 when powertop was updated from version 2.10 to 2.14

This might need to be raised as a bug with the powertop developer.

3 Likes

Peter has disabled debug_fs for security reasons so i fear powertop will not work with kernel 6.x

https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=12d339e725cf093947c2d0243a724e014d5ef8d4

3 Likes

Hi @arne_f .
Aah. I had misread what module was causing the problem. Thanks for the clarification.

Looking up the kernel explanation for that module, I also can’t see that being enabled again in IPFire.

Debugfs exists as a simple way for kernel developers to make information available to user space. Unlike /proc, which is only meant for information about a process, or sysfs, which has strict one-value-per-file rules, debugfs has no rules at all. Developers can put any information they want there. The debugfs filesystem is also intended to not serve as a stable ABI to user space; in theory, there are no stability constraints placed on files exported there.

Having an option that allows someone to access data from the kernel or maybe even put stuff in there, does not seem like the sort of security hole you want on a firewall. It’s clear that the intent is for developers of the kernel to access debug info when they are modifying or upgrading the kernel. Once the kernel is fixed then there is no real use case for that module to be used.

I am surprised that it is required by the powertop tool. I would have expected that it should get all the info it requires from the /proc or similar directory tree.

I suspect we will now be re-visiting the removal of powertop from the addons list, as it seems that it won’t work without that option.

5 Likes

Thank you @bonnietwin and @arne_f .

If Powertop can’t work without Debugfs and Debugfs is disabled for security reasons, then I guess it should be removed.

I couldn’t find why PowerTOP relies on Debugfs, but “for the LOLs” I asked ChatGPT:

One of the ways that PowerTOP achieves this is by reading power usage data from the kernel’s ACPI subsystem. However, some of the data that PowerTOP needs is not available through the regular sysfs interface, which is the main way that user-space programs access information about the kernel and its subsystems.

To work around this limitation, PowerTOP relies on the debugfs filesystem, which provides a way to expose additional kernel data to user-space programs. Specifically, PowerTOP uses the debugfs interface to access information about processor idle states, which is crucial for identifying opportunities to reduce power usage.

This sounds plausible but ChatGPT could not provide me direct references for this information, just generic links to PowerTOP and kernel documentation about debugfs.

PS: I was checking on PowerTop in a shell because I noticed my home system has been using higher CPU frequencies on average. See below the CPU frequency on this 4 core system since late February. I’ve made no significant changes in configuration and I changed my /etc/sysconfig/rc.local file back to using the old methods of setting PowerTop-like power optimisations.

Load average and memory usage (not pictured) have not changed significantly during the same time period.

Anyway, thank you for your help here. I’ll search around and raise another thread with more detail when I’m ready to troubleshoot this further.

Thank you again!
Save

Re the question about higher frequencies see these posts/threads.

https://community.ipfire.org/t/ipfire-2-27-core-update-173-is-available-for-testing/9322/5
https://community.ipfire.org/t/ipfire-2-27-core-update-173-high-cpu-frequency/9473

4 Likes