Re: [linux-pm] [PATCH 0/8] Suspend block api (version 8)

From: Felipe Contreras
Date: Sat Jun 05 2010 - 13:30:46 EST


On Thu, Jun 3, 2010 at 6:28 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Thu, 2010-06-03 at 16:12 +0200, Florian Mickler wrote:
>> On Thu, 03 Jun 2010 09:40:02 +0200
>> Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>>
>> > Same for firefox, you can teach it to not render animated gifs and run
>> > javascript for invisible tabs, and once the screen-saver kicks in,
>> > nothing is visible (and with X telling apps their window is visible or
>> > not it knows), so it should go idle all of its own.
>> >
>> > Fix the friggin apps, don't kludge with freezing.
>>
>> Of course programs should be as smart as possible. But that is an
>> orthogonal problem.
>>
>> Suppose firefox were fixed. It still needs to fetch my rss feeds every
>> minute, because I'm sad if it doesn't. It just can't be fixed at the
>> application level.
>
> Sure it can, why would it need to fetch RSS feeds when the screen is off
> and nobody could possible see the result? So you can stop the timer when
> you know the window isn't visible or alternatively when the screensaver
> is active, I think most desktops have notification of that as well.

Exactly, and that's what applications in the N900 do. For this to work
reliably, you need these notifications (network disconnected, screen
off) to be easily accessible, and even transparent to the application
writer.

I don't think the suspend blockers solve much. A bad application will
behave bad on any system. Suppose somebody decides to port Firefox to
Android, and forgets to listen to the screen off event (bad on Android
or Maemo), however, notices the application behaves very badly, so by
googling finds these suspend blockers, and enables them all the time
the application runs.

When the user install the application, will be greeted by a warning
"This application might break PM, do you want to enable suspend
blockers?" (or whatever), as any typical user would do, will press Yes
(whatever).

We end up in exactly the same situation.

--
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/