linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Arve Hjønnevåg" <arve@android.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	tytso@mit.edu, Brian Swetland <swetland@google.com>,
	Neil Brown <neilb@suse.de>,
	Alan Stern <stern@rowland.harvard.edu>,
	Felipe Balbi <felipe.balbi@nokia.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Florian Mickler <florian@mickler.org>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	Linux PM <linux-pm@lists.linux-foundation.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	James Bottomley <James.Bottomley@suse.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: suspend blockers & Android integration
Date: Sun, 6 Jun 2010 00:11:06 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1006052348200.2933@localhost.localdomain> (raw)
In-Reply-To: <AANLkTinD39rI47innPbGz1Gi8PsXV5HqkmaQuJ70oQ63@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 4928 bytes --]

On Sat, 5 Jun 2010, Arve Hjønnevåg wrote:
> 2010/6/5 Thomas Gleixner <tglx@linutronix.de>:
> > B1;2005;0cOn Fri, 4 Jun 2010, Arve Hjønnevåg wrote:
> >> > Why is it a BUG in the trusted app, when I initiate a download and put
> >> > the phone down ?
> >> >
> >>
> >> It is not, but we have had bugs where a trusted app does not unblock
> >> suspend after some failure case where it is no longer making any
> >> progress.
> >
> > Well, that's simply an application bug which sucks battery with or
> > without suspend blockers. So it's unrelated to the freezing of
> > untrusted apps while a trusted app still works in the background
> > before allowing the machine to suspend.
> >
> 
> It is not unrelated if the trusted app has stopped working but still
> blocks suspend. The battery drains when you combine them.

What you are describing is a problem which is not solvable either way.
If you take the lock and do not release it you're not going to
suspend. I never claimed that any other mechanism resolves this.

But this is not related to the fact that freezing crap while running a
sane background task is going to save you power vs. an approach where
running a sane background task allows crap to consume power unconfined
until it is done.

> >> > That download might take a minute or two, but that's not an
> >> > justification for the crapplication to run unconfined and prevent
> >> > lower power states.
> >> >
> >>
> >> I agree, but this is not a simple problem to solve.
> >
> > Not with suspend blockers, but with cgroup confinement of crap, it's
> > straight forward.
> >
> 
> I don't think is is straight forward. If the a process in the frozen
> group holds a resource that a process in the unfrozen group needs, how
> do deal with that?

I'm going to fix the framework which puts the group into freeze state
w/o making sure that there is no held shared resource. Come on it's
not rocket science.
 
> >> Yes I don't know everything our user-space stack is doing, but I do
> >> know that it makes many calls between processes (and in both
> >> directions). As far as I know it uses timeouts when calling into
> >> untrusted code, so a misbehaving application will cause an error
> >> dialog to pop up asking if the user if it should wait longer or
> >> terminate the application.
> >
> > Sigh, the more I learn about the details of android and it's violation
> > of all sane engineering principles the more I understand why you
> > invented a huge nail to push through all layers in order to bring the
> > system into idle at all. And yes, you need a sledge hammer to drive
> > that big nail through everything, so you are using the right tool.
> >
> > Seriously, the cross app call goes through your framework, which
> > already knows, that the untrusted part is frozen. So it can deal
> > nicely with it in any way you want including unfreezing.
> 
> Cross app calls do not go through a central process.

It's not about a central process, it goes through your framework,
which should be able to deal with it. If not, it's a design failure
which needs to be fixed at the place where the failure happened.
 
> >>
> >> How can it be fixed? The user presses the back button, the framework
> >> determines that app A is in the foreground and send the key to app A,
> >> app A decides that it it does not have anything internal to go back to
> >> and tells the framework to switch back to the previous app. If the
> >> user presses the back key again, the framework does not know which app
> >> this key should go to until app A has finished processing the first
> >> key press.
> >
> > Errm, what has this to do with frozen apps? If your system is
> > handling input events then there are no frozen apps and even if they
> > are frozen your framework can unfreeze them _before_ talking to them.
> >
> > So which unfixable problem are you describing with the above example ?
> >
> 
> You are claiming that trusted code should not have any dependencies on
> untrusted code. I gave you a visible example of such a dependency and
> want you to tell me how you can avoid this dependency. Since you are
> claiming that our user-space framework is fundamentally broken if it
> has to wait for untrusted code, I don't think it is unreasonable for
> you to answer this. Or do you think it is valid to communicate with
> untrusted code when the screen is on but not when it is off.

It does not matter whether the screen is off or not. If you need to
call into that untrusted app from your trusted app and you know about
the might be frozen state then you can deal with it.

So taking your example:

Event happens and gets delivered to the framework

      framework selects A because it is in the foreground
      
      if (A is frozen)
      	 unfreeze(A)

      deliver_event_to(A)

It's that simple.

If your framework cannot deal with that simple problem then you have a
much more serious problem already.

Thanks,

	tglx

  reply	other threads:[~2010-06-05 22:11 UTC|newest]

Thread overview: 195+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-03 19:30 suspend blockers & Android integration Ingo Molnar
2010-06-03 19:50 ` Brian Swetland
2010-06-04  7:57   ` Ingo Molnar
2010-06-04  8:29     ` Brian Swetland
2010-06-04  8:55       ` Ingo Molnar
2010-06-04  9:03         ` Pekka Enberg
2010-06-04  9:08         ` Brian Swetland
2010-06-04  9:59           ` Ingo Molnar
2010-06-04 10:09             ` Brian Swetland
2010-06-04 14:24             ` James Bottomley
2010-06-04 15:07               ` Florian Mickler
2010-06-06  8:04           ` david
2010-06-10 13:58       ` Pavel Machek
2010-06-11  4:21         ` [linux-pm] " David Brownell
2010-06-11 14:28           ` James Bottomley
2010-06-11 14:46             ` Alan Stern
2010-06-11 15:01               ` Mark Brown
2010-06-11 15:02               ` James Bottomley
2010-06-11 20:48                 ` Alan Stern
2010-06-11 21:04                   ` James Bottomley
2010-06-12 17:10                   ` Mark Brown
2010-06-12  2:43             ` David Brownell
2010-06-11 14:42           ` Alan Stern
     [not found] ` <20100603231153.GA11302@elte.hu>
2010-06-03 23:23   ` Ingo Molnar
2010-06-03 23:37     ` Linus Torvalds
2010-06-03 23:46       ` Ingo Molnar
2010-06-04  2:16         ` Linus Torvalds
2010-06-04  2:26           ` Linus Torvalds
2010-06-04  3:45             ` Arjan van de Ven
2010-06-04  4:46               ` Linus Torvalds
2010-06-04 10:42                 ` Andi Kleen
2010-06-04  8:15               ` Ingo Molnar
2010-06-06  8:16               ` david
2010-06-06  8:23             ` david
2010-06-04  3:45           ` Arve Hjønnevåg
2010-06-04  6:22           ` Ingo Molnar
2010-06-04  8:11           ` Ingo Molnar
2010-06-05 20:37           ` Florian Mickler
2010-06-04  0:39     ` Ingo Molnar
2010-06-04 14:50       ` Alan Stern
2010-06-04  4:38     ` Neil Brown
2010-06-04  4:54     ` Arve Hjønnevåg
2010-06-04  7:13       ` Ingo Molnar
2010-06-04  7:37         ` Arve Hjønnevåg
2010-06-04  8:34           ` Ingo Molnar
2010-06-04  8:56             ` Arve Hjønnevåg
2010-06-04 12:06               ` Peter Zijlstra
2010-06-05  0:10                 ` Arve Hjønnevåg
2010-06-05  9:54                   ` Peter Zijlstra
2010-06-05 16:28                     ` Arjan van de Ven
2010-06-05 21:26                       ` Arve Hjønnevåg
2010-06-05 22:23                         ` Arjan van de Ven
2010-06-05 22:26                           ` Brian Swetland
2010-06-05 22:48                             ` Arjan van de Ven
2010-06-05 23:45                               ` Thomas Gleixner
2010-06-06  0:34                               ` Arve Hjønnevåg
2010-06-05 22:52                             ` Rafael J. Wysocki
2010-06-05 22:39                           ` Arve Hjønnevåg
2010-06-05 23:34                             ` Arjan van de Ven
2010-06-06  0:02                               ` Arve Hjønnevåg
2010-06-06 11:18                           ` Felipe Contreras
2010-06-06 11:26                             ` david
2010-06-06  7:52                         ` [linux-pm] " Vitaly Wool
2010-06-06  8:20                           ` Brian Swetland
2010-06-06  8:32                             ` Vitaly Wool
2010-06-06  9:21                               ` Brian Swetland
2010-06-06  9:56                                 ` david
2010-06-06 11:11                                   ` Felipe Contreras
2010-06-06 10:00                                 ` Vitaly Wool
2010-06-06 10:12                                   ` david
2010-06-06 10:19                                     ` [linux-pm] " Vitaly Wool
2010-06-06 10:49                                       ` Florian Mickler
2010-06-06 10:57                                         ` Vitaly Wool
2010-06-06 11:14                                         ` [linux-pm] " david
2010-06-07 12:16                                           ` Florian Mickler
2010-06-09  1:14                                             ` david
2010-06-09  3:46                                               ` Linus Torvalds
2010-06-09  7:43                                                 ` [linux-pm] " Felipe Contreras
2010-06-09  9:40                                                   ` Rafael J. Wysocki
2010-06-09 22:04                                                     ` Neil Brown
2010-06-10  8:59                                                       ` Rafael J. Wysocki
2010-06-10 12:00                                                         ` Neil Brown
2010-06-10 16:06                                                           ` Rafael J. Wysocki
2010-06-10 13:57                                                         ` Mark Brown
2010-06-10 15:46                                                           ` Rafael J. Wysocki
2010-06-10 19:01                                                             ` Mark Brown
2010-06-10 14:47                                                         ` Alan Stern
2010-06-10 15:44                                                           ` Rafael J. Wysocki
2010-06-06 10:46                                   ` Florian Mickler
2010-06-06 11:05                                     ` Alan Cox
2010-06-06 13:34                                       ` Matthew Garrett
2010-06-06 14:31                                       ` James Bottomley
2010-06-06 15:46                                         ` [linux-pm] " Thomas Gleixner
2010-06-06 17:08                                           ` James Bottomley
2010-06-06 18:04                                             ` Thomas Gleixner
2010-06-06 18:44                                               ` Brian Swetland
2010-06-06 19:26                                                 ` Thomas Gleixner
2010-06-06 19:05                                             ` [linux-pm] " Christoph Hellwig
2010-06-06 19:15                                               ` Brian Swetland
2010-06-06 19:24                                                 ` [linux-pm] " Christoph Hellwig
2010-06-06 19:58                                                   ` Brian Swetland
2010-06-06 22:26                                                     ` Thomas Gleixner
2010-06-07  8:00                                                       ` Christoph Hellwig
2010-06-07  8:03                                                     ` Christoph Hellwig
2010-06-07  8:16                                                       ` Brian Swetland
2010-06-07 13:20                                                     ` Peter Zijlstra
2010-06-07 18:40                                                       ` David Brownell
2010-06-07 23:17                                                       ` Linus Walleij
2010-06-07 23:37                                                         ` Brian Swetland
2010-06-08  2:15                                                         ` Valdis.Kletnieks
2010-06-09 12:33                                                     ` [linux-pm] " Mark Brown
2010-07-09 19:11                                                     ` HTC Dream drivers was " Pavel Machek
2010-06-06 13:31                                   ` Matthew Garrett
2010-06-06 15:26                                     ` Vitaly Wool
2010-06-06 15:29                                       ` Matthew Garrett
2010-06-06 15:47                                         ` Vitaly Wool
2010-06-06 16:43                                           ` Matthew Garrett
2010-06-06 17:21                                             ` Vitaly Wool
2010-06-06 17:31                                               ` Matthew Garrett
2010-06-06 19:01                                                 ` Rafael J. Wysocki
2010-06-07 10:25                                                 ` Felipe Contreras
2010-06-07 13:01                                               ` Florian Mickler
2010-06-07  0:01                                         ` Alan Stern
2010-06-07  1:07                                           ` [linux-pm] suspend blockers & Android integrationy Thomas Gleixner
2010-06-07 14:42                                             ` Alan Stern
2010-06-07 15:49                                               ` Thomas Gleixner
2010-06-07 15:56                                           ` [linux-pm] suspend blockers & Android integration Florian Mickler
2010-06-08  0:57                                           ` Arve Hjønnevåg
2010-06-08  1:13                                             ` Alan Stern
2010-06-04  9:43     ` Peter Zijlstra
2010-06-04  9:54       ` Peter Zijlstra
2010-06-04 10:03         ` Ingo Molnar
2010-06-04 10:08           ` Peter Zijlstra
2010-06-04 10:11             ` Brian Swetland
2010-06-04 10:11         ` Thomas Gleixner
2010-06-04 10:13           ` Peter Zijlstra
2010-06-04 23:38       ` Rafael J. Wysocki
2010-06-05  0:05         ` Thomas Gleixner
2010-06-05  0:39           ` Arve Hjønnevåg
2010-06-05  1:18             ` Matt Helsley
2010-06-05  5:35               ` Arve Hjønnevåg
2010-06-05 18:25                 ` Rafael J. Wysocki
2010-06-05 22:10                   ` Arve Hjønnevåg
2010-06-05 23:03                     ` Rafael J. Wysocki
2010-06-06  1:03                       ` Arve Hjønnevåg
2010-06-06  2:49                         ` Alan Stern
2010-06-06 11:09                           ` [linux-pm] " Alan Stern
2010-06-08  0:23                             ` Arve Hjønnevåg
2010-06-08  1:09                               ` Alan Stern
2010-06-08  1:31                                 ` Arve Hjønnevåg
2010-06-08  2:32                                   ` Alan Stern
2010-06-08  3:05                                     ` Arve Hjønnevåg
2010-06-08 10:19                                       ` Florian Mickler
2010-06-08 14:50                                       ` Alan Stern
2010-06-09  1:48                                         ` Arve Hjønnevåg
2010-06-09 15:29                                           ` Alan Stern
2010-06-09 23:42                                             ` Arve Hjønnevåg
2010-06-10  4:21                                               ` david
2010-06-10  4:51                                                 ` Arve Hjønnevåg
2010-06-10  5:10                                                   ` Neil Brown
2010-06-10 14:39                                                 ` Alan Stern
2010-06-10 14:28                                               ` Alan Stern
2010-06-10 23:02                                                 ` Arve Hjønnevåg
2010-06-11  1:44                                                   ` Alan Stern
2010-06-11  3:16                                                     ` Arve Hjønnevåg
2010-06-11 14:33                                                       ` Alan Stern
2010-06-11 22:18                                                         ` Arve Hjønnevåg
2010-06-12 15:22                                                           ` [linux-pm] " Alan Stern
2010-06-07 23:16                           ` Arve Hjønnevåg
2010-06-06 13:29                         ` Rafael J. Wysocki
2010-06-05  1:33             ` Thomas Gleixner
2010-06-05  5:23               ` Arve Hjønnevåg
2010-06-05 16:47                 ` Thomas Gleixner
2010-06-05 21:47                   ` Arve Hjønnevåg
2010-06-05 22:11                     ` Thomas Gleixner [this message]
2010-06-05 23:21                       ` Arve Hjønnevåg
2010-06-05 23:39                         ` Rafael J. Wysocki
2010-06-06  0:04                         ` Thomas Gleixner
2010-06-06  1:16                           ` Arve Hjønnevåg
2010-06-06 10:36                             ` Thomas Gleixner
2010-06-06 14:43                               ` Matt Helsley
2010-06-08  0:45                                 ` Arve Hjønnevåg
2010-06-07 23:34                               ` Arve Hjønnevåg
2010-06-06 10:56                             ` Thomas Gleixner
2010-06-08  0:05                               ` Arve Hjønnevåg
2010-06-06  0:19                         ` Thomas Gleixner
2010-06-06  1:24                           ` Arve Hjønnevåg
2010-06-06  0:32                         ` Thomas Gleixner
2010-06-06  1:45                           ` Arve Hjønnevåg
2010-06-06 10:01                             ` Thomas Gleixner
2010-06-05 22:44                     ` Rafael J. Wysocki
2010-06-05 23:56                       ` Arve Hjønnevåg
2010-06-06 13:55                         ` Rafael J. Wysocki
2010-06-08  0:39                           ` Arve Hjønnevåg
2010-06-08  9:11                             ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.1006052348200.2933@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=James.Bottomley@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=arve@android.com \
    --cc=felipe.balbi@nokia.com \
    --cc=florian@mickler.org \
    --cc=hpa@zytor.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@elte.hu \
    --cc=neilb@suse.de \
    --cc=peterz@infradead.org \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    --cc=swetland@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).