ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #04001
Re: Catching CPU run-aways on Touch
On 09/05/2013 07:01 AM, Alberto Mardegan wrote:
> On 09/05/2013 12:42 PM, Colin Ian King wrote:
>> On 05/09/13 10:33, Colin Ian King wrote:
>>> On 05/09/13 10:23, Evan Dandrea wrote:
>>>> Stuart Langridge brought up an interesting idea for this on IRC, which
>>>> I'm copying here rather than having more side discussions:
> [...]
>
> Oops, I should have read the whole thread before posting my previous
> e-mail. :-)
>
>> Anyhow, I still think myAppIsRunning() is open to abuse as it will in
>> time be lavishly added to all sorts of tight loops that suck CPU, which
>> just adds more overhead on the long run.
>
> Well, if we don't have a myAppIsRunning() API, apps can simply busy-loop
> whenever they want, so I don't see much harm in adding this API.
> We could also protect it with apparmor, so that the usage of this API
> must be explicitly declared in the application's manifest file (and then
> we could question whether the app has any reason to use it).
>
We can't control access to library calls in this manner. You can mmap the
library and get everything, or you can't. We can't block the mmap of the library
because an app could just ship its own version of the library and mmap it. If
the library called out to an out of process helper over dbus, then we could
mediate it. That is pretty over the top though and I'm not convinced having this
perm is worthwhile anyway-- we almost certainly wouldn't have a contextual
runtime prompt for the access and appstore reviewers would almost certainly
always allow it-- so the perm becomes meaningless.
I think the point of this API is not to protect against abuse, but to allow a
well-intentioned app from getting killed. To me, an abusive app will be handled
by bad reviews/bug reports ("This app sucks-- my battery is dead in 5 minutes
whenever I use it"). Because we don't have a way to distinguish between
accidental and intentional high CPU usage now, we don't have anything other than
app reviews. If we introduce this call, we can detect the accidental high CPU
usage now. The handful of apps that abuse it can still be handled via user
reviews like they are now.
--
Jamie Strandboge http://www.ubuntu.com/
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups
References