LWN.net Logo

A single power preference knob

A single power preference knob

Posted Jun 24, 2010 8:17 UTC (Thu) by TRS-80 (subscriber, #1804)
Parent article: A single power preference knob

This sounds like a job for a simple userspace program to me.


(Log in to post comments)

A single power preference knob

Posted Jun 24, 2010 8:48 UTC (Thu) by riteshsarraf (subscriber, #11138) [Link]

Currently, laptop-mode-tools does most of what has been proposed in the RFC.

What I did not see in the RFC is is whether the switch from one profile to another is going to be adaptive or event driven.

In laptop-mode-tools, we do this based on events. Currently, ON_BAT and ON_AC.

A single power preference knob

Posted Jun 24, 2010 12:49 UTC (Thu) by nescafe (subscriber, #45063) [Link]

Yeah, I pointed out in the thread that the knob he proposed does not really map to what most userspace programs that care about power management actually do.

A single power preference knob

Posted Jun 24, 2010 12:21 UTC (Thu) by kov (subscriber, #7423) [Link]

I had the same gut reaction.

A single power preference knob

Posted Jun 24, 2010 12:24 UTC (Thu) by NRArnot (subscriber, #3033) [Link]

Seconded. (+padding - LWN won't let me post a 9 byte comment)

9 byte comments not allowed you say?

Posted Jun 24, 2010 16:09 UTC (Thu) by ccurtis (guest, #49713) [Link]

I expect there's some very sound logic for such a restriction ...

Now, if only LWN had an optional "private reply" checkbox on the comment form...

A single power preference knob

Posted Jun 24, 2010 13:05 UTC (Thu) by Tobu (subscriber, #24111) [Link]

I agree that the kernel shouldn't contain complex policy, and should give ultimate control over policy to userland. But apparently the settings to tweak range wide and userland is missing some.

This master knob could provide a default value for settings that have yet to be tweaked by userland. When switching modes, the userland tweaks the master knob, then whatever knobs it is aware of. The problem with this is that most driver settings don't have an “unset, please fall back to the default” value. As a consequence, with the current proposal the default value can only be read by drivers that don't expose settings to userland yet. To be effective with existing, exposed settings, the master trigger would have to trigger changes to every one of them, and that's not something that should be done in-kernel.

Other solutions to the breadth of settings would be:

  • an annotation mechanism that lists the knobs and a documentation tool that checks every knob appears in the Documentation directory;
  • blessing one of the userland tools and requiring kernel drivers to update the tool as well;
  • an introspection mechanism that lists the knobs, their range, and a default value for at least two power modes.

I like the introspection approach myself, since it will lead to better userland tools. Those tools should be able to discover and tweak settings they don't know about, and expose them to the user. It would also provide a good platform for experimenting with a watt meter.

A single power preference knob

Posted Jun 24, 2010 16:51 UTC (Thu) by nescafe (subscriber, #45063) [Link]

Introspection is of limited usability -- it is ultimately up to the end user or the distro to decide what level of power management makes sense for a given use case. I prefer the more complete documentation option.

A single power preference knob

Posted Jun 24, 2010 23:04 UTC (Thu) by hummassa (subscriber, #307) [Link]

I disagree strongly. I think this kind of parameters should be enumerable in a ALSA mixer like way.

A single power preference knob

Posted Jun 25, 2010 1:20 UTC (Fri) by nescafe (subscriber, #45063) [Link]

Enumerable is fine -- exposing them all in a /sys/power/powersave_knobs directory (or wherever) would be awesome. Once that is done, we can work on adding features that make it easier to introspect on them.

A single power preference knob

Posted Jun 25, 2010 0:12 UTC (Fri) by Tobu (subscriber, #24111) [Link]

Hopefully the userland can figure out a value from the introspection. If the knob exposes a range with two examples, a “powersave” value and a “balanced” value, the userland can pick the powersave value for powersave and more energy-efficient modes, and the balanced value for balanced and more performance-oriented modes. Generally: pick the example nearest the desired mode.

If you have a more advanced user willing to figure things out, you can let them view the range, pick values and submit a patch, but that doesn't need to be the default user experience.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds