Wakelocks
Wakelocks
Posted Dec 23, 2011 0:08 UTC (Fri) by neilbrown (subscriber, #359)In reply to: Wakelocks by brendan_wright
Parent article: Bringing Android closer to the mainline
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).
