suspend/resume PM criterion for application

Ran Shalit ranshalit at gmail.com
Wed Sep 10 14:58:48 EDT 2014


On Wed, Sep 10, 2014 at 9:39 PM,  <Valdis.Kletnieks at vt.edu> wrote:
> On Wed, 10 Sep 2014 21:23:28 +0300, Ran Shalit said:
>
>> As far as I understand, suspend/respond PM is not per device, but for
>> all system,
>> and wakeup source will resume again the whole system.
>> I think you mean runtime suspend/resume in the answer.
>
> The original question didn't specify. You said "suspending that application",
> not the entire system.
>
> And runtime suspend/resume of devices and even the CPU does fit within
> your original question constraints.
>
> If you're looking at system-wide suspend/resume specificially, there's
> two basic schemes in use:
>
> 1) User hits a button, acpid or similar notices, and does a suspend to
> disk/ram/papertape/whatever.
>
> 2) User hits a button, closes the lid, or a user inactivity timer expires.
> A process notices, and asks all processes which have registered for suspend
> notifications "Is it OK if we suspend?", and if nobody says "Nay", it does it.
> If a process complains, it is repeatedly polled until it finishes whatever it
> was doing and says "OK now".

Hi Veldis,

The second scheme you mention is what I am required to achieve, but it
raises some question:
> or a user inactivity timer expires. A process notices...
1. How can I make a process to notice this inactivity ? Do you think
it can be implemented by some periodic process who check if there is
activity ? It returns to the original question I raised, that I will
use some periodic process who checks maybe cpu load or something like
that. What do you think ?
> and asks all processes which have registered for suspend notifications "Is it OK if we suspend?
2. What Do you mean here by process ?  Do you mean SW process which
register for suspend notification (how do we do this) ? What about
devices which register for suspend/resume. Must they accept the
suspend ?

Thanks very much,
Ran



More information about the Kernelnewbies mailing list