[Pm-utils] Canceling resume
Victor Lowther
victor.lowther at gmail.com
Fri Nov 20 06:03:33 PST 2009
On Fri, 2009-11-20 at 13:10 +0000, Enrico Zini wrote:
> On Thu, Nov 19, 2009 at 10:34:44AM -0600, Victor Lowther wrote:
>
> > >However, upon resume pm-utils will run the various scripts in
> > >/etc/pm in
> > >order. The idea would be to have a hook, say, 80-openmoko, that tells
> > >pm-utils: "forget it, we need to go back to sleep". And at that point
> > >pm-utils will:
> > >1. stop running further resume scripts
> > >2. start running suspend hooks starting from the one that canceled the
> > > resume 80-openmoko
> > >3. suspend again
> >
> > It seems like a reasonable request, nut it is not obvious how to
> > implement it in a general way.
>
> It looks like I was following the wrong approach. I took some timings,
> and standard pm-utils scripts seem to be a bit too heavyweight for a
> mobile phone:
>
> 00auto-quirk suspend... result: 0 0.721047sec
> 00logging suspend... result: 0 0.800695sec
> 00powersave suspend... result: 0 1.787498sec
> 49bluetooth suspend... result: 254 0.551373sec
> 55NetworkManager suspend... result: 254 0.769849sec
> 55wicd suspend... result: 252 2.561117sec
> 75modules suspend... result: 254 1.077796sec
> 90clock suspend... result: 254 0.808920sec
> 94cpufreq suspend... result: 0 0.612665sec
> 95led suspend... result: 254 0.106237sec
> 98smart-kernel-video suspend... result: 254 0.715426sec
> 99video suspend... result: 0 1.037772sec
> 99video resume... result: 0 4.003470sec
> 98smart-kernel-video resume... result: 0 0.755774sec
> 95led resume... result: 254 0.112618sec
> 94cpufreq resume... result: 0 0.678049sec
> 90clock resume... result: 254 0.629024sec
> 75modules resume... result: 0 0.843291sec
> 55wicd resume... result: 252 2.202079sec
> 55NetworkManager resume... result: 254 0.772729sec
> 49bluetooth resume... result: 254 0.696186sec
> 00powersave resume... result: 0 2.062235sec
> 00logging resume... result: 0 0.554852sec
> 00auto-quirk resume... result: 0 0.732000sec
Woah, shell scripts do not perform well at all on openmoko -- those
times are at least 3 orders of magnitude slower than our usual x86
laptop platform. Which shell are you using as /bin/sh?
>
> This is not your fault, you're obviously targeting a different platform.
>
> But I would still want to allow openmoko apps to be installed on my
> desktop and still work, so I'd like to have, on my phone, suspend/resume
> plugins that are compatible with pm-utils.
Neat, I will check it out.
> To that end, I prototyped a "light" version of pm-utils:
> http://git.debian.org/?p=users/enrico/omhacks.git
>
> It tries to do the same, but it's implemented in C, it's simple minded
> and it does not ship the default heavyweight pm-utils hooks.
Yeah, most of the default hooks that pm-utils ships with are probably
not needed on a celphone. :)
>
> It also implements "cancel resume", when a hook exits with status 250.
>
> It's all still a proof of concept, and it hasn't proven the concept yet:
> I'm now trying to port a complicated suspend/resume setup to it to see
> if it copes.
>
> I seems like a reasonable tradeoff to me to have the normal pm-utils and
> a lighter version that at least share the standard behaviours, so if the
> idea is viable I could be quite happy with it.
>
> Only, I'd like the standard to stay in sync. I've had to pick an extra
> special exit status to implement "cancel resume", and it might be a good
> idea if we eventually standardise it, so that the proper pm-utils don't
> pick it in the future for something else, forcing all scripts that use
> that feature to be rewritten.
I do not have a problem with standardizing on exit code 250 as cancel
resume.
> Ciao,
>
> Enrico
>
> _______________________________________________
> Pm-utils mailing list
> Pm-utils at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pm-utils
More information about the Pm-utils
mailing list