User: Password:
|
|
Subscribe / Log in / New account

Wakelocks

Wakelocks

Posted Dec 22, 2011 23:46 UTC (Thu) by brendan_wright (guest, #7376)
In reply to: Wakelocks by dlang
Parent article: Bringing Android closer to the mainline

Because to save power and battery life, the OS needs to know that it can quickly suspend after user input has ceased even though 5 browser tabs are busy doing constant updates of moving HTML ads. But it also needs to know that it can't susped the CPU when it's busy rendering a 3D scene, or the screen when a movie is playing. Linux should have best in class power managment, and to do that it needs more information from userspace apps.


(Log in to post comments)

Wakelocks

Posted Dec 23, 2011 0:08 UTC (Fri) by neilbrown (subscriber, #359) [Link]

Certainly the OS needs to know when it can suspend quickly and userspace apps need to provide that information.

But the "kernel" doesn't need to be particularly involved in this. User-space apps can talk to user-space suspend manager and when an appropriate time to suspend arrives the user-space suspend manager can initiate a suspend.

wakelocks as a feature are perfectly fine. However they don't need to be a kernel feature.

(well .. to be accurate there does need to be a way for kernel modules such as drivers to hold-off suspend for a while, but we have that - they are called wakeup-sources. Userspace uses a separate mechanism that is more fitting for user-space).

(and to be completely fair - there is a school of thought which says that we shouldn't be using suspend at all and so wakelocks aren't fine no matter where they are implemented. Adherents of this school believe that when a tab isn't visible the animation on it should stop and then when nothing is using CPU the CPU should reduce power usage. It is hard to argue against this in terms of elegance of the design. Whether it is practical is somewhat easier to argue against).

Wakelocks

Posted Dec 23, 2011 11:15 UTC (Fri) by brendan_wright (guest, #7376) [Link]

> Certainly the OS needs to know when it can suspend quickly and userspace apps need to provide that information.

> But the "kernel" doesn't need to be particularly involved in this.

I'm not fussed about how it works, just as long as we're not still arguing about either the need for them, or the implementation details, in two years time! :-/

Wakelocks

Posted Dec 23, 2011 4:03 UTC (Fri) by dlang (subscriber, #313) [Link]

however, taking a wakelock is a privileged operation, so most programs are not allowed to do so.

this greatly undermines the "this is the only way to make things work" argument.

Wakelocks

Posted Dec 23, 2011 11:27 UTC (Fri) by brendan_wright (guest, #7376) [Link]

> this greatly undermines the "this is the only way to make things work" argument.

I don't think anyone here is saying they are the *only* way to "make things work". But they are a working implementation of a feature I think we need ASAP.


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