|
|
Log in / Subscribe / Register

Power-management knobs

By Jonathan Corbet
November 2, 2015

2015 Kernel Summit
Rafael Wysocki started off his 2015 Kernel Summit session by noting that every generation of hardware promises to be more power-efficient than its predecessor. But that efficiency is not always experienced by users. In an ideal world, systems should run in the most power-efficient mode whenever possible and only employ the less-efficient modes when performance requirements demand it. Real-world systems, though, tend not to run as efficiently as they can. Rafael came with a proposal that, he thought, might improve the situation, but it's not clear that the idea will be implemented.

Any hardware (be it a CPU or a peripheral device) with multiple operating states has to be able to detect when it is safe to change between modes. Almost all hardware has some power-related modes that it is able to employ, but, increasingly, power-efficient operation is not something that a device can choose independently from the rest of the system. A modern system-on-chip (SoC) includes a lot of devices in a single package; these devices share the same power-distribution mechanism. Often, many or all devices must go into a low-power state before the shared power hardware can change state, so a single misconfigured device can keep much of the system in a high-power state. And, as it happens, devices are often configured to not use their lower-power states.

This configuration is done for a number of reasons, but it mostly comes down to safety. Some hardware can misbehave when running in a low-power state, and the consequences of that misbehavior can be severe. Sometimes the problem is in the driver, which does not handle low-power states well. Power-management support tends to be seen, rightly or wrongly, as being experimental, so developers often disable it. And sometimes there are legitimate performance concerns that argue against the use of low-power states.

Power-management configuration can be tricky; there are a lot of knobs in the system that affect it in one way or another. There is usually at least one knob for every driver, often more; few users even know how to find all of these knobs, much less configure them properly. Rafael would like to make life easier for users wanting to tune their systems for power use; to that end, he has proposed the addition of a high-level switch that would enable power management globally. This switch would have to be a command-line parameter, since it needs to be set at boot time.

The switch would have the two obvious settings: "performance" and "power." There could also be a setting to enable power-management settings that are still seen as experimental; braver users could turn that on as well.

There were concerns expressed about the boot-time switch, since it cannot be changed in the powertop utility. A few developers suggested that, rather than adding a global knob, developers should make it easier for users to discover and set power-management options. Standardizing the operation of device-specific power-management knobs would help, as would better documentation of the various knobs found in sysfs. Knobs that are known to be experimental or dangerous should be explicitly marked as such; that might give users more confidence when it comes to tweaking the safer knobs.

Darren Hart suggested that a global power-management policy could be implemented in user space if all of the relevant settings were standardized, discoverable, and well documented. Rafael pointed out that the runtime power management knobs are already standardized, but they still tend to remain set in the "disabled" state. Still, the sense of the group seemed to be that better discoverability and documentation were preferable to a global knob implemented in the kernel. So future work is likely to be focused in that area.

Index entries for this article
KernelPower management
ConferenceKernel Summit/2015


to post comments

Power-management knobs

Posted Nov 3, 2015 21:56 UTC (Tue) by flussence (guest, #85566) [Link] (1 responses)

Not all runtime knobs are standardized: my laptop exposes a turbo mode through /sys/devices/platform/eeepc/cpufv (or a broken write-only one in eeepc-wmi/ if I don't set acpi_osi=Linux...); the Linux kernel doesn't talk to my desktop LCD's backlight controls (but userspace apps running as root, and MSWin can), and so on.

I personally would wish for an even higher level interface than an on/off switch — to express things like "limit fan noise by throttling when the lid's closed", or "disable cpufreq-ondemand until the load from this compile job/game I'm running goes away".

Power-management knobs

Posted Nov 4, 2015 12:05 UTC (Wed) by k3ninho (subscriber, #50375) [Link]

>I personally would wish for an even higher level interface than an on/off switch — to express things like "limit fan noise by throttling when the lid's closed", or "disable cpufreq-ondemand until the load from this compile job/game I'm running goes away".

I think that eBPF programs are a ^great^ place to implement such logic. Perhaps with something we'll call *e*eBPF (evenmore extended Berkeley Packet Filtering) which can compose and evaluate Prolog expressions?

(It may not be apparent that the carets '^' indicate sarcasm, this being a joke about the growth of places you might use eBPF in the kernel.)

K3n.

Power-management knobs

Posted Nov 5, 2015 9:44 UTC (Thu) by riteshsarraf (subscriber, #11138) [Link] (1 responses)

Do we really have a need for a Global Power Management knob in the Linux kernel?

There are many tools, that already do it in the user space, like Laptop Mode Tools. There will always be users, with one odd flaky hardware, that breaks the entire power management savings. Tools like LMT, provide the flexibility for the user to choose and handle such odd configurations too. Of course, a distribution vendor can choose a sane default.

The ultimate power saving rule is to let the CPU sleep and avoid any unwanted I/O. I think a bigger problem is in the GNU/Linux application space. With a variety of application coming from different projects (Firefox, Chromium, KDE, GNOME etc) and not having a unified standard, the end result is not what it could be. They don't always talk (or understand) well to each other, let alone any savings.

Sure things have improved a lot over the years. But it still is not optimum. Applications still mis-behave, that leads to no synergy amongst them (cross toolkit apps) and the kernel. Ultimately leading to a power hungry Linux distribution.

Power-management knobs

Posted Dec 6, 2015 9:24 UTC (Sun) by petermag (guest, #7550) [Link]

"Userspace tools for power management"? This sounds like an opportunity for exploitation here. Ie, if any user can do their own power management, are we not at a security risks? And so even if it is done at the userspace level, you still need kernel to provide the knobs, in particular I suspect LMT does so too.


Copyright © 2015, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds