From: Alan Cox Subject: Re: [linux-pm] [PATCH 0/8] Suspend block api (version 8) Date: Fri, 28 May 2010 17:31:51 +0100 Message-ID: <20100528173151.2c5f6fde@lxorguk.ukuu.org.uk> References: <20100527223605.GB11364@srcf.ucam.org> <20100527235546.09f3ce8a@lxorguk.ukuu.org.uk> <20100528043114.GC26177@thunk.org> <20100528103713.0a7952d9@lxorguk.ukuu.org.uk> <20100528114123.GA22947@srcf.ucam.org> <4BFFB681.1000105@nokia.com> <4BFFC5DF.5030504@nokia.com> <20100528133900.GG26177@thunk.org> <4BFFCFC7.7070302@nokia.com> <20100528142124.GA26733@srcf.ucam.org> <20100528160628.7c121dab@lxorguk.ukuu.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-14 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from earthlight.etchedpixels.co.uk ([81.2.110.250]:60972 "EHLO www.etchedpixels.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932135Ab0E1QZ3 convert rfc822-to-8bit (ORCPT ); Fri, 28 May 2010 12:25:29 -0400 In-Reply-To: Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Brian Swetland Cc: Matthew Garrett , Igor Stoppa , tytso@mit.edu, Peter Zijlstra , LKML , Florian Mickler , Linux PM , Thomas Gleixner , Linux OMAP Mailing List , "Balbi Felipe (Nokia-D/Helsinki)" > I think Arve's concern was the representation of the "I care, but onl= y > a little" or "just low enough to ensure threads must run" level which > is what suspend blockers would map to (low enough to ensure we > shouldn't halt the world but not necessarily implying a hard latency > constraint beyond that). That's why I suggested "manyana" (can't get accents for ma=F1ana in a define) or perhaps "dreckly"[1]. They are both words that mean "at some point" but in a very very vague and 'relax it'll happen eventually' sen= se. More importantly it's policy. It's a please meet this constraint guide to the PM layer - not a you must do as say even if its stupid. > > They fix a general problem in terms of a driver specific item. We e= nd up > > making changes around the tree but we make everyone happy not just > > Android. Also we are isolating policy properly. The apps and driver= s say > > "I have these needs", the power manager figures out how to meet the= m. >=20 > That makes sense -- and as I've mentioned elsewhere, we're really not > super picky about naming -- if it turns out that > wakelocks/suspendblockers were shorthand for "request a qos constrain= t > that ensures that threads are running", we'll be able to get things > done just as well as we do now. Cool. I think they are or at least they are close enough that nobody wi= ll notice the join ;) > > Where it gets ugly is if you start trying to have drivers giving an= app a > > guarantee which the app then magically has to know to dispose of. >=20 > Yeah -- which is something we've avoided in the existing model with > overlapping wakelocks during handoff between domains. I'm not sure avoided is the right description - its there in all its identical ugliness in wakelock magic If you treat QoS guarantees as a wakelock for your purposes (which is just fine, drivers and apps give you policy, you use it how you like) then you could write the paragraph below substituting the word 'guarantee' for 'wakelock' So in that sense the mess is the same becaus= e in both cases you are trying to suspend active tasks rather than asking the task to behave and then taking remedial action with offenders. > - input service is select()ing on input devices > - when select() returns it grabs a wakelock, reads events, passes the= m > on, releases the wakelock > - the event subsystem can then safely drop its "should be running > threads" constraint as soon as the last event is read because it has > no queues for userspace to drain, but the overlapping wakelock > prevents the system from immediately snapping back to sleep The conventional PC model is 'we don't go back into sleep proper fast enough for that race to occur'. It's hard to see how you change it. An app->device "thank you for that event, I enjoyed it very much and have finished with it" message moves the underlying event management and QoS knowledge into he driver proper but doesn't really change the interface= =2E > > If you are prepared to exclude untrusted apps from perfectly reliab= le > > event reporting (ie from finger to application action) that doesn't= seem > > to be a neccessity anyway. >=20 > Currently in the Android userpace only trusted (system) apps can > directly obtain wakelocks -- arbitrary apps obtain them via rpc to a > trusted system service (which ensures the app has been granted > permission to do this and tracks usage for accountability to > user/developer). Clearly that would continue to work out. Alan [1] Dreckly being used in Cornwall, as one friend put it 'Like man=E3na= but without that dreadful sense of urgency' -- To unsubscribe from this list: send the line "unsubscribe linux-omap" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html