|
|
Subscribe / Log in / New account

Suspend block

By Jonathan Corbet
April 28, 2010
One of the key points of contention when it comes to getting the kernel-level Android code merged has been the wakelock API. Wakelocks run counter to how some think power management should be done, so they have been hard to merge. But Android's drivers use wakelocks, so, in the absence of that API, those drivers also cannot be merged. They could be reworked to not use wakelocks, but then the mainline kernel would have a forked version of the driver code which nobody actually uses - not the best of outcomes. So coming to resolution on the wakelock issue has been a high priority for a while.

The result of work in that area can now be seen in the form of the suspend block patches recently posted by Arve Hjønnevåg. The name of the feature has been changed, as has the API, but the core point is the same: allow the system to automatically suspend itself when nothing is going on, and allow code to say "something is going on" at both the kernel and user-space levels.

The suspend block patches add a new sysfs file called /sys/power/policy; the default value found therein is "forced." When the policy is "forced," system state transitions will happen in response to explicit writes to /sys/power/state, as usual. If the policy is changed to "opportunistic," though, things are a bit different. The state written to /sys/power/state does not take effect immediately; instead, the kernel goes into that state whenever it concludes that the system is idle. The suspend blocker API can then be used to prevent the system from suspending when the need arises.

The two postings of this patch set have received a number of comments, causing various things to be fixed. More recently, though, responses have been of the "acked" variety. So one might conclude that suspend block has a reasonable chance of getting in during the 2.6.35 merge window. That, in turn, should open the doors for the merging of a lot of driver code from the Android project. With luck, the much-publicized disconnect between Android and the community may be a thing of the past - at the kernel level, at least.

Index entries for this article
KernelAndroid
KernelPower management/Opportunistic suspend


to post comments

Suspend block

Posted Apr 30, 2010 5:53 UTC (Fri) by pranith (subscriber, #53092) [Link] (1 responses)

All hail Greg KH for the effort. Thanks Greg :)

Suspend block

Posted May 3, 2010 8:32 UTC (Mon) by swetland (guest, #63414) [Link]

I'd like to thank Ted Ts'o for working with the Linux Foundation folks to organize a productive meeting with a bunch of Android and mainline kernel folks at the Linux Collab Summit, where we got a chance to hash out a lot of details around wakelocks/suspendblockers in a pretty friendly environment, face to face.

It's nice to find ways to work together rather than just getting shouted at.


Copyright © 2010, 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