All of lore.kernel.org
 help / color / mirror / Atom feed
* suspend/resume PM criterion for application
@ 2014-09-10 17:26 ` Ran Shalit
  0 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 17:26 UTC (permalink / raw)
  To: kernelnewbies, linux-pm

Hello,

What is usually the criterion for PM (power management) suspending
that application shall use ? Is it according to minimum threshold for
cpu load (as indication for no process) ?

How usually it is performed, i.e.  is it some periodic process, which
wakes up periodically to check criterion for cpu load ? If so, isn't
it problematic in PM terms, becuase it mean that the system is resumed
periodically (as a result of the the periodic timer's interrupt), and
all devices are resumed ?

Thanks,
Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-10 17:26 ` Ran Shalit
  0 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 17:26 UTC (permalink / raw)
  To: kernelnewbies

Hello,

What is usually the criterion for PM (power management) suspending
that application shall use ? Is it according to minimum threshold for
cpu load (as indication for no process) ?

How usually it is performed, i.e.  is it some periodic process, which
wakes up periodically to check criterion for cpu load ? If so, isn't
it problematic in PM terms, becuase it mean that the system is resumed
periodically (as a result of the the periodic timer's interrupt), and
all devices are resumed ?

Thanks,
Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-10 17:26 ` Ran Shalit
@ 2014-09-10 17:59   ` Valdis.Kletnieks at vt.edu
  -1 siblings, 0 replies; 24+ messages in thread
From: Valdis.Kletnieks @ 2014-09-10 17:59 UTC (permalink / raw)
  To: Ran Shalit; +Cc: kernelnewbies, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

On Wed, 10 Sep 2014 20:26:48 +0300, Ran Shalit said:

> What is usually the criterion for PM (power management) suspending
> that application shall use ? Is it according to minimum threshold for
> cpu load (as indication for no process) ?

That will be highly application dependent.  Something that checks your email
in the background may not care at all, as long as it gets network
access every 5 minutes or so, and the entire system can power down for 4 minutes
and 58 seconds as far as it cares.  If it's doing media streaming, it may
insist on having at least one CPU burst per screen refresh, and the CPU can
go to sleep for the rest of the 1/30th of  a second.

> How usually it is performed, i.e.  is it some periodic process, which
> wakes up periodically to check criterion for cpu load ? If so, isn't
> it problematic in PM terms, becuase it mean that the system is resumed
> periodically (as a result of the the periodic timer's interrupt), and
> all devices are resumed ?

No, it can be done on a per-device basis.

'powertop' is a possibly useful tool for playing with this stuff that will
let you look at power management on the fly.

[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-10 17:59   ` Valdis.Kletnieks at vt.edu
  0 siblings, 0 replies; 24+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-09-10 17:59 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 10 Sep 2014 20:26:48 +0300, Ran Shalit said:

> What is usually the criterion for PM (power management) suspending
> that application shall use ? Is it according to minimum threshold for
> cpu load (as indication for no process) ?

That will be highly application dependent.  Something that checks your email
in the background may not care at all, as long as it gets network
access every 5 minutes or so, and the entire system can power down for 4 minutes
and 58 seconds as far as it cares.  If it's doing media streaming, it may
insist on having at least one CPU burst per screen refresh, and the CPU can
go to sleep for the rest of the 1/30th of  a second.

> How usually it is performed, i.e.  is it some periodic process, which
> wakes up periodically to check criterion for cpu load ? If so, isn't
> it problematic in PM terms, becuase it mean that the system is resumed
> periodically (as a result of the the periodic timer's interrupt), and
> all devices are resumed ?

No, it can be done on a per-device basis.

'powertop' is a possibly useful tool for playing with this stuff that will
let you look at power management on the fly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140910/a5a9af7e/attachment.bin 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-10 17:59   ` Valdis.Kletnieks at vt.edu
@ 2014-09-10 18:23     ` Ran Shalit
  -1 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 18:23 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: kernelnewbies, linux-pm

On Wed, Sep 10, 2014 at 8:59 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Wed, 10 Sep 2014 20:26:48 +0300, Ran Shalit said:
>
>> What is usually the criterion for PM (power management) suspending
>> that application shall use ? Is it according to minimum threshold for
>> cpu load (as indication for no process) ?
>
> That will be highly application dependent.  Something that checks your email
> in the background may not care at all, as long as it gets network
> access every 5 minutes or so, and the entire system can power down for 4 minutes
> and 58 seconds as far as it cares.  If it's doing media streaming, it may
> insist on having at least one CPU burst per screen refresh, and the CPU can
> go to sleep for the rest of the 1/30th of  a second.
>
>> How usually it is performed, i.e.  is it some periodic process, which
>> wakes up periodically to check criterion for cpu load ? If so, isn't
>> it problematic in PM terms, becuase it mean that the system is resumed
>> periodically (as a result of the the periodic timer's interrupt), and
>> all devices are resumed ?
>
> No, it can be done on a per-device basis.
>
> 'powertop' is a possibly useful tool for playing with this stuff that will
> let you look at power management on the fly.

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.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-10 18:23     ` Ran Shalit
  0 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 18:23 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Sep 10, 2014 at 8:59 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Wed, 10 Sep 2014 20:26:48 +0300, Ran Shalit said:
>
>> What is usually the criterion for PM (power management) suspending
>> that application shall use ? Is it according to minimum threshold for
>> cpu load (as indication for no process) ?
>
> That will be highly application dependent.  Something that checks your email
> in the background may not care at all, as long as it gets network
> access every 5 minutes or so, and the entire system can power down for 4 minutes
> and 58 seconds as far as it cares.  If it's doing media streaming, it may
> insist on having at least one CPU burst per screen refresh, and the CPU can
> go to sleep for the rest of the 1/30th of  a second.
>
>> How usually it is performed, i.e.  is it some periodic process, which
>> wakes up periodically to check criterion for cpu load ? If so, isn't
>> it problematic in PM terms, becuase it mean that the system is resumed
>> periodically (as a result of the the periodic timer's interrupt), and
>> all devices are resumed ?
>
> No, it can be done on a per-device basis.
>
> 'powertop' is a possibly useful tool for playing with this stuff that will
> let you look at power management on the fly.

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.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-10 18:23     ` Ran Shalit
@ 2014-09-10 18:39       ` Valdis.Kletnieks at vt.edu
  -1 siblings, 0 replies; 24+ messages in thread
From: Valdis.Kletnieks @ 2014-09-10 18:39 UTC (permalink / raw)
  To: Ran Shalit; +Cc: kernelnewbies, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

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".

[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-10 18:39       ` Valdis.Kletnieks at vt.edu
  0 siblings, 0 replies; 24+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-09-10 18:39 UTC (permalink / raw)
  To: kernelnewbies

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".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140910/50d7bc7b/attachment.bin 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-10 18:39       ` Valdis.Kletnieks at vt.edu
@ 2014-09-10 18:58         ` Ran Shalit
  -1 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 18:58 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: kernelnewbies, linux-pm

On Wed, Sep 10, 2014 at 9:39 PM,  <Valdis.Kletnieks@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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-10 18:58         ` Ran Shalit
  0 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 18:58 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Sep 10, 2014 at 9:39 PM,  <Valdis.Kletnieks@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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-10 18:58         ` Ran Shalit
@ 2014-09-10 19:25           ` Valdis.Kletnieks at vt.edu
  -1 siblings, 0 replies; 24+ messages in thread
From: Valdis.Kletnieks @ 2014-09-10 19:25 UTC (permalink / raw)
  To: Ran Shalit; +Cc: linux-pm, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1288 bytes --]

On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:

> 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 ?

That's going to depend on your system and what processes are running.

You may have an MP3 player going that doesn't take much CPU at all - but
shutting down because the user hasn't hit a button in 47 minutes will probably
irritate the user no end.  Or there may be a screensaver running that takes
twice as much CPU as the MP3 player, but is totally OK on the system
suspending whenever the rest of the system wants it.

You're going to have to look at your system design, and decide for yourself
what the criteria are.


> 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 ?

I believe Android already has libraries and monitor processes for this.

It's really hard to give more specific advice without knowing what your
hardware, software, and usage is.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 848 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-10 19:25           ` Valdis.Kletnieks at vt.edu
  0 siblings, 0 replies; 24+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-09-10 19:25 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:

> 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 ?

That's going to depend on your system and what processes are running.

You may have an MP3 player going that doesn't take much CPU at all - but
shutting down because the user hasn't hit a button in 47 minutes will probably
irritate the user no end.  Or there may be a screensaver running that takes
twice as much CPU as the MP3 player, but is totally OK on the system
suspending whenever the rest of the system wants it.

You're going to have to look at your system design, and decide for yourself
what the criteria are.


> 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 ?

I believe Android already has libraries and monitor processes for this.

It's really hard to give more specific advice without knowing what your
hardware, software, and usage is.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140910/eb7c4cad/attachment.bin 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-10 19:25           ` Valdis.Kletnieks at vt.edu
@ 2014-09-10 19:31             ` Ran Shalit
  -1 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 19:31 UTC (permalink / raw)
  To: Valdis Kletnieks; +Cc: kernelnewbies, linux-pm

On Wed, Sep 10, 2014 at 10:25 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>
>> 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 ?
>
> That's going to depend on your system and what processes are running.
>
> You may have an MP3 player going that doesn't take much CPU at all - but
> shutting down because the user hasn't hit a button in 47 minutes will probably
> irritate the user no end.  Or there may be a screensaver running that takes
> twice as much CPU as the MP3 player, but is totally OK on the system
> suspending whenever the rest of the system wants it.
>
> You're going to have to look at your system design, and decide for yourself
> what the criteria are.
>
>
>> 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 ?
>
> I believe Android already has libraries and monitor processes for this.
>
> It's really hard to give more specific advice without knowing what your
> hardware, software, and usage is.

Ok, Thanks, I just tried to understand and learn from your previous answer.
I have OMAP Soc and knows that the linux SDK supports suspend/resume
and other mechnism. I did n't hear about the notification before.

Thanks, Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-10 19:31             ` Ran Shalit
  0 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-10 19:31 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Sep 10, 2014 at 10:25 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>
>> 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 ?
>
> That's going to depend on your system and what processes are running.
>
> You may have an MP3 player going that doesn't take much CPU at all - but
> shutting down because the user hasn't hit a button in 47 minutes will probably
> irritate the user no end.  Or there may be a screensaver running that takes
> twice as much CPU as the MP3 player, but is totally OK on the system
> suspending whenever the rest of the system wants it.
>
> You're going to have to look at your system design, and decide for yourself
> what the criteria are.
>
>
>> 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 ?
>
> I believe Android already has libraries and monitor processes for this.
>
> It's really hard to give more specific advice without knowing what your
> hardware, software, and usage is.

Ok, Thanks, I just tried to understand and learn from your previous answer.
I have OMAP Soc and knows that the linux SDK supports suspend/resume
and other mechnism. I did n't hear about the notification before.

Thanks, Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-10 19:25           ` Valdis.Kletnieks at vt.edu
@ 2014-09-11  5:32             ` AYAN KUMAR HALDER
  -1 siblings, 0 replies; 24+ messages in thread
From: AYAN KUMAR HALDER @ 2014-09-11  5:32 UTC (permalink / raw)
  To: Valdis Kletnieks; +Cc: Ran Shalit, linux-pm, kernelnewbies

On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>
>> 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 ?
>
> That's going to depend on your system and what processes are running.
>
> You may have an MP3 player going that doesn't take much CPU at all - but
> shutting down because the user hasn't hit a button in 47 minutes will probably
> irritate the user no end.  Or there may be a screensaver running that takes
> twice as much CPU as the MP3 player, but is totally OK on the system
> suspending whenever the rest of the system wants it.
>
> You're going to have to look at your system design, and decide for yourself
> what the criteria are.

Please correct me if my understanding is wrong:-

I believe that autosuspend feature (for system suspend) is not present
in kernel. I believe that there is no feature in kernel which checks
for system ( cpu, devices) inactivity and suspends the entire system.
System suspend is caused when :-
1. the user issues a command
2. The system receives some interrupt or event (lid closing event)
3. There is an external process which monitors system inactivity and
suspends the system.

For runtime suspend of a device, I believe it is the driver who has
the complete responsibility to decide when to suspend the device or
resume it.  The driver can take this decision on user intervention (eg
when user writes to   /sys/devices/<my-device>/power/* ) or when the
driver has completed servicing an interrupt and feels it has nothing
more to do, etc

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-11  5:32             ` AYAN KUMAR HALDER
  0 siblings, 0 replies; 24+ messages in thread
From: AYAN KUMAR HALDER @ 2014-09-11  5:32 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>
>> 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 ?
>
> That's going to depend on your system and what processes are running.
>
> You may have an MP3 player going that doesn't take much CPU at all - but
> shutting down because the user hasn't hit a button in 47 minutes will probably
> irritate the user no end.  Or there may be a screensaver running that takes
> twice as much CPU as the MP3 player, but is totally OK on the system
> suspending whenever the rest of the system wants it.
>
> You're going to have to look at your system design, and decide for yourself
> what the criteria are.

Please correct me if my understanding is wrong:-

I believe that autosuspend feature (for system suspend) is not present
in kernel. I believe that there is no feature in kernel which checks
for system ( cpu, devices) inactivity and suspends the entire system.
System suspend is caused when :-
1. the user issues a command
2. The system receives some interrupt or event (lid closing event)
3. There is an external process which monitors system inactivity and
suspends the system.

For runtime suspend of a device, I believe it is the driver who has
the complete responsibility to decide when to suspend the device or
resume it.  The driver can take this decision on user intervention (eg
when user writes to   /sys/devices/<my-device>/power/* ) or when the
driver has completed servicing an interrupt and feels it has nothing
more to do, etc

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-11  5:32             ` AYAN KUMAR HALDER
@ 2014-09-11  9:24               ` Ran Shalit
  -1 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-11  9:24 UTC (permalink / raw)
  To: AYAN KUMAR HALDER; +Cc: Valdis Kletnieks, linux-pm, kernelnewbies

On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <ayankumarh@gmail.com> wrote:
> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>>
>>> 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 ?
>>
>> That's going to depend on your system and what processes are running.
>>
>> You may have an MP3 player going that doesn't take much CPU at all - but
>> shutting down because the user hasn't hit a button in 47 minutes will probably
>> irritate the user no end.  Or there may be a screensaver running that takes
>> twice as much CPU as the MP3 player, but is totally OK on the system
>> suspending whenever the rest of the system wants it.
>>
>> You're going to have to look at your system design, and decide for yourself
>> what the criteria are.
>
> Please correct me if my understanding is wrong:-
>
> I believe that autosuspend feature (for system suspend) is not present
> in kernel. I believe that there is no feature in kernel which checks
> for system ( cpu, devices) inactivity and suspends the entire system.
> System suspend is caused when :-
> 1. the user issues a command
> 2. The system receives some interrupt or event (lid closing event)
> 3. There is an external process which monitors system inactivity and
> suspends the system.
>
> For runtime suspend of a device, I believe it is the driver who has
> the complete responsibility to decide when to suspend the device or
> resume it.  The driver can take this decision on user intervention (eg
> when user writes to   /sys/devices/<my-device>/power/* ) or when the
> driver has completed servicing an interrupt and feels it has nothing
> more to do, etc

Thanks Vlaid, Ayan,

I am a bit yet struggling for couple of days on this PM issue, and I
would appreciate your continous advise.
The system requirement I have is as following:
1. make everything as automatic as possible , so that there won't be
any need to add any userspace application for the matter.
2. wakeup from all relevant wakeup sources
3. should not use sysfs (it should be disabled from kernel)
4. platform is OMAP3530.

Now, As I understand thus far, I have the following options (
requirement 3 above I will ignore, don't know how to handle it yet,
and assume for meanwhile that I have sysfs) :
1. use suspend scheme (no runtime PM)
    1.a. create some kernel thread who check cpu load and will decide
to disable system only if its below some minimum threshold (which
should indicate no activity)
    1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
    with this scheme only this thread is responsible for the suspend,
and there is no use of the runtime PM, right ?

2. use runtime PM scheme :
    With this scheme I don't understand how some device will wake the
system , or doesn't it need to  ? If a driver wakes up maybe it need
to deliver some info to system    ?

I think option 1 is also easier to support, what do you think about both ?

Thanks!!
Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-11  9:24               ` Ran Shalit
  0 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-11  9:24 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <ayankumarh@gmail.com> wrote:
> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>>
>>> 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 ?
>>
>> That's going to depend on your system and what processes are running.
>>
>> You may have an MP3 player going that doesn't take much CPU at all - but
>> shutting down because the user hasn't hit a button in 47 minutes will probably
>> irritate the user no end.  Or there may be a screensaver running that takes
>> twice as much CPU as the MP3 player, but is totally OK on the system
>> suspending whenever the rest of the system wants it.
>>
>> You're going to have to look at your system design, and decide for yourself
>> what the criteria are.
>
> Please correct me if my understanding is wrong:-
>
> I believe that autosuspend feature (for system suspend) is not present
> in kernel. I believe that there is no feature in kernel which checks
> for system ( cpu, devices) inactivity and suspends the entire system.
> System suspend is caused when :-
> 1. the user issues a command
> 2. The system receives some interrupt or event (lid closing event)
> 3. There is an external process which monitors system inactivity and
> suspends the system.
>
> For runtime suspend of a device, I believe it is the driver who has
> the complete responsibility to decide when to suspend the device or
> resume it.  The driver can take this decision on user intervention (eg
> when user writes to   /sys/devices/<my-device>/power/* ) or when the
> driver has completed servicing an interrupt and feels it has nothing
> more to do, etc

Thanks Vlaid, Ayan,

I am a bit yet struggling for couple of days on this PM issue, and I
would appreciate your continous advise.
The system requirement I have is as following:
1. make everything as automatic as possible , so that there won't be
any need to add any userspace application for the matter.
2. wakeup from all relevant wakeup sources
3. should not use sysfs (it should be disabled from kernel)
4. platform is OMAP3530.

Now, As I understand thus far, I have the following options (
requirement 3 above I will ignore, don't know how to handle it yet,
and assume for meanwhile that I have sysfs) :
1. use suspend scheme (no runtime PM)
    1.a. create some kernel thread who check cpu load and will decide
to disable system only if its below some minimum threshold (which
should indicate no activity)
    1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
    with this scheme only this thread is responsible for the suspend,
and there is no use of the runtime PM, right ?

2. use runtime PM scheme :
    With this scheme I don't understand how some device will wake the
system , or doesn't it need to  ? If a driver wakes up maybe it need
to deliver some info to system    ?

I think option 1 is also easier to support, what do you think about both ?

Thanks!!
Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-11  9:24               ` Ran Shalit
@ 2014-09-14  6:11                 ` Ran Shalit
  -1 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-14  6:11 UTC (permalink / raw)
  To: AYAN KUMAR HALDER; +Cc: Valdis Kletnieks, linux-pm, kernelnewbies

On Thu, Sep 11, 2014 at 12:24 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <ayankumarh@gmail.com> wrote:
>> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
>>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>>>
>>>> 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 ?
>>>
>>> That's going to depend on your system and what processes are running.
>>>
>>> You may have an MP3 player going that doesn't take much CPU at all - but
>>> shutting down because the user hasn't hit a button in 47 minutes will probably
>>> irritate the user no end.  Or there may be a screensaver running that takes
>>> twice as much CPU as the MP3 player, but is totally OK on the system
>>> suspending whenever the rest of the system wants it.
>>>
>>> You're going to have to look at your system design, and decide for yourself
>>> what the criteria are.
>>
>> Please correct me if my understanding is wrong:-
>>
>> I believe that autosuspend feature (for system suspend) is not present
>> in kernel. I believe that there is no feature in kernel which checks
>> for system ( cpu, devices) inactivity and suspends the entire system.
>> System suspend is caused when :-
>> 1. the user issues a command
>> 2. The system receives some interrupt or event (lid closing event)
>> 3. There is an external process which monitors system inactivity and
>> suspends the system.
>>
>> For runtime suspend of a device, I believe it is the driver who has
>> the complete responsibility to decide when to suspend the device or
>> resume it.  The driver can take this decision on user intervention (eg
>> when user writes to   /sys/devices/<my-device>/power/* ) or when the
>> driver has completed servicing an interrupt and feels it has nothing
>> more to do, etc
>
> Thanks Vlaid, Ayan,
>
> I am a bit yet struggling for couple of days on this PM issue, and I
> would appreciate your continous advise.
> The system requirement I have is as following:
> 1. make everything as automatic as possible , so that there won't be
> any need to add any userspace application for the matter.
> 2. wakeup from all relevant wakeup sources
> 3. should not use sysfs (it should be disabled from kernel)
> 4. platform is OMAP3530.
>
> Now, As I understand thus far, I have the following options (
> requirement 3 above I will ignore, don't know how to handle it yet,
> and assume for meanwhile that I have sysfs) :
> 1. use suspend scheme (no runtime PM)
>     1.a. create some kernel thread who check cpu load and will decide
> to disable system only if its below some minimum threshold (which
> should indicate no activity)
>     1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
>     with this scheme only this thread is responsible for the suspend,
> and there is no use of the runtime PM, right ?
>
> 2. use runtime PM scheme :
>     With this scheme I don't understand how some device will wake the
> system , or doesn't it need to  ? If a driver wakes up maybe it need
> to deliver some info to system    ?
>
> I think option 1 is also easier to support, what do you think about both ?
>
> Thanks!!
> Ran

Does Anyone have any suggestions and feedback on the above requirements ?

Thank you,
Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-14  6:11                 ` Ran Shalit
  0 siblings, 0 replies; 24+ messages in thread
From: Ran Shalit @ 2014-09-14  6:11 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Sep 11, 2014 at 12:24 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <ayankumarh@gmail.com> wrote:
>> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
>>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>>>
>>>> 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 ?
>>>
>>> That's going to depend on your system and what processes are running.
>>>
>>> You may have an MP3 player going that doesn't take much CPU at all - but
>>> shutting down because the user hasn't hit a button in 47 minutes will probably
>>> irritate the user no end.  Or there may be a screensaver running that takes
>>> twice as much CPU as the MP3 player, but is totally OK on the system
>>> suspending whenever the rest of the system wants it.
>>>
>>> You're going to have to look at your system design, and decide for yourself
>>> what the criteria are.
>>
>> Please correct me if my understanding is wrong:-
>>
>> I believe that autosuspend feature (for system suspend) is not present
>> in kernel. I believe that there is no feature in kernel which checks
>> for system ( cpu, devices) inactivity and suspends the entire system.
>> System suspend is caused when :-
>> 1. the user issues a command
>> 2. The system receives some interrupt or event (lid closing event)
>> 3. There is an external process which monitors system inactivity and
>> suspends the system.
>>
>> For runtime suspend of a device, I believe it is the driver who has
>> the complete responsibility to decide when to suspend the device or
>> resume it.  The driver can take this decision on user intervention (eg
>> when user writes to   /sys/devices/<my-device>/power/* ) or when the
>> driver has completed servicing an interrupt and feels it has nothing
>> more to do, etc
>
> Thanks Vlaid, Ayan,
>
> I am a bit yet struggling for couple of days on this PM issue, and I
> would appreciate your continous advise.
> The system requirement I have is as following:
> 1. make everything as automatic as possible , so that there won't be
> any need to add any userspace application for the matter.
> 2. wakeup from all relevant wakeup sources
> 3. should not use sysfs (it should be disabled from kernel)
> 4. platform is OMAP3530.
>
> Now, As I understand thus far, I have the following options (
> requirement 3 above I will ignore, don't know how to handle it yet,
> and assume for meanwhile that I have sysfs) :
> 1. use suspend scheme (no runtime PM)
>     1.a. create some kernel thread who check cpu load and will decide
> to disable system only if its below some minimum threshold (which
> should indicate no activity)
>     1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
>     with this scheme only this thread is responsible for the suspend,
> and there is no use of the runtime PM, right ?
>
> 2. use runtime PM scheme :
>     With this scheme I don't understand how some device will wake the
> system , or doesn't it need to  ? If a driver wakes up maybe it need
> to deliver some info to system    ?
>
> I think option 1 is also easier to support, what do you think about both ?
>
> Thanks!!
> Ran

Does Anyone have any suggestions and feedback on the above requirements ?

Thank you,
Ran

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-14  6:11                 ` Ran Shalit
@ 2014-09-17  3:16                   ` Peter Teoh
  -1 siblings, 0 replies; 24+ messages in thread
From: Peter Teoh @ 2014-09-17  3:16 UTC (permalink / raw)
  To: Ran Shalit; +Cc: Valdis Kletnieks, linux-pm, AYAN KUMAR HALDER, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 4906 bytes --]

On Sun, Sep 14, 2014 at 2:11 AM, Ran Shalit <ranshalit@gmail.com> wrote:

> On Thu, Sep 11, 2014 at 12:24 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> > On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <ayankumarh@gmail.com>
> wrote:
> >> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
> >>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
> >>>
> >>>> 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 ?
> >>>
> >>> That's going to depend on your system and what processes are running.
> >>>
> >>> You may have an MP3 player going that doesn't take much CPU at all -
> but
> >>> shutting down because the user hasn't hit a button in 47 minutes will
> probably
> >>> irritate the user no end.  Or there may be a screensaver running that
> takes
> >>> twice as much CPU as the MP3 player, but is totally OK on the system
> >>> suspending whenever the rest of the system wants it.
> >>>
> >>> You're going to have to look at your system design, and decide for
> yourself
> >>> what the criteria are.
> >>
> >> Please correct me if my understanding is wrong:-
> >>
> >> I believe that autosuspend feature (for system suspend) is not present
> >> in kernel. I believe that there is no feature in kernel which checks
> >> for system ( cpu, devices) inactivity and suspends the entire system.
> >> System suspend is caused when :-
> >> 1. the user issues a command
> >> 2. The system receives some interrupt or event (lid closing event)
> >> 3. There is an external process which monitors system inactivity and
> >> suspends the system.
> >>
> >> For runtime suspend of a device, I believe it is the driver who has
> >> the complete responsibility to decide when to suspend the device or
> >> resume it.  The driver can take this decision on user intervention (eg
> >> when user writes to   /sys/devices/<my-device>/power/* ) or when the
> >> driver has completed servicing an interrupt and feels it has nothing
> >> more to do, etc
> >
> > Thanks Vlaid, Ayan,
> >
> > I am a bit yet struggling for couple of days on this PM issue, and I
> > would appreciate your continous advise.
> > The system requirement I have is as following:
> > 1. make everything as automatic as possible , so that there won't be
> > any need to add any userspace application for the matter.
> > 2. wakeup from all relevant wakeup sources
> > 3. should not use sysfs (it should be disabled from kernel)
> > 4. platform is OMAP3530.
>

a.   look into /arch/arm/mach-omap2 of kernel source and grep for "sleep"
and "wakeup" functionality:   power management is just managing with the
different frequencies of the the CPU.   as far as I can tell, once sleep,
only uart pin can be used for waking up....not sure.

b.   read this:

http://e2e.ti.com/support/dsp/omap_applications_processors/f/447/t/30005.aspx

http://www.ti.com/lit/an/slva310b/slva310b.pdf   (read page 2, which
describe the different powerup-sequence of the CPU, "Powering-Up Sequence".


c.   the technology brand name for omap3530 is "DVFS"....search for this
inside the arch/arm kernel source.....you can find lots of sample codes
there.

(don't confuse with another omap CPU brand name "DeepSleep" but is PM for
another type of omap cpu.)

d.   http://www.ti.com/product/omap3530 --> on the right is a DVSDK +
Android source code for 3530....grep the codes for the above keywords...

hopefully it helps?



> >
> > Now, As I understand thus far, I have the following options (
> > requirement 3 above I will ignore, don't know how to handle it yet,
> > and assume for meanwhile that I have sysfs) :
> > 1. use suspend scheme (no runtime PM)
> >     1.a. create some kernel thread who check cpu load and will decide
> > to disable system only if its below some minimum threshold (which
> > should indicate no activity)
> >     1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
> >     with this scheme only this thread is responsible for the suspend,
> > and there is no use of the runtime PM, right ?
> >
> > 2. use runtime PM scheme :
> >     With this scheme I don't understand how some device will wake the
> > system , or doesn't it need to  ? If a driver wakes up maybe it need
> > to deliver some info to system    ?
> >
> > I think option 1 is also easier to support, what do you think about both
> ?
> >
> > Thanks!!
> > Ran
>
> Does Anyone have any suggestions and feedback on the above requirements ?
>
> Thank you,
> Ran
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Peter Teoh

[-- Attachment #1.2: Type: text/html, Size: 7062 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-17  3:16                   ` Peter Teoh
  0 siblings, 0 replies; 24+ messages in thread
From: Peter Teoh @ 2014-09-17  3:16 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Sep 14, 2014 at 2:11 AM, Ran Shalit <ranshalit@gmail.com> wrote:

> On Thu, Sep 11, 2014 at 12:24 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> > On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <ayankumarh@gmail.com>
> wrote:
> >> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
> >>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
> >>>
> >>>> 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 ?
> >>>
> >>> That's going to depend on your system and what processes are running.
> >>>
> >>> You may have an MP3 player going that doesn't take much CPU at all -
> but
> >>> shutting down because the user hasn't hit a button in 47 minutes will
> probably
> >>> irritate the user no end.  Or there may be a screensaver running that
> takes
> >>> twice as much CPU as the MP3 player, but is totally OK on the system
> >>> suspending whenever the rest of the system wants it.
> >>>
> >>> You're going to have to look at your system design, and decide for
> yourself
> >>> what the criteria are.
> >>
> >> Please correct me if my understanding is wrong:-
> >>
> >> I believe that autosuspend feature (for system suspend) is not present
> >> in kernel. I believe that there is no feature in kernel which checks
> >> for system ( cpu, devices) inactivity and suspends the entire system.
> >> System suspend is caused when :-
> >> 1. the user issues a command
> >> 2. The system receives some interrupt or event (lid closing event)
> >> 3. There is an external process which monitors system inactivity and
> >> suspends the system.
> >>
> >> For runtime suspend of a device, I believe it is the driver who has
> >> the complete responsibility to decide when to suspend the device or
> >> resume it.  The driver can take this decision on user intervention (eg
> >> when user writes to   /sys/devices/<my-device>/power/* ) or when the
> >> driver has completed servicing an interrupt and feels it has nothing
> >> more to do, etc
> >
> > Thanks Vlaid, Ayan,
> >
> > I am a bit yet struggling for couple of days on this PM issue, and I
> > would appreciate your continous advise.
> > The system requirement I have is as following:
> > 1. make everything as automatic as possible , so that there won't be
> > any need to add any userspace application for the matter.
> > 2. wakeup from all relevant wakeup sources
> > 3. should not use sysfs (it should be disabled from kernel)
> > 4. platform is OMAP3530.
>

a.   look into /arch/arm/mach-omap2 of kernel source and grep for "sleep"
and "wakeup" functionality:   power management is just managing with the
different frequencies of the the CPU.   as far as I can tell, once sleep,
only uart pin can be used for waking up....not sure.

b.   read this:

http://e2e.ti.com/support/dsp/omap_applications_processors/f/447/t/30005.aspx

http://www.ti.com/lit/an/slva310b/slva310b.pdf   (read page 2, which
describe the different powerup-sequence of the CPU, "Powering-Up Sequence".


c.   the technology brand name for omap3530 is "DVFS"....search for this
inside the arch/arm kernel source.....you can find lots of sample codes
there.

(don't confuse with another omap CPU brand name "DeepSleep" but is PM for
another type of omap cpu.)

d.   http://www.ti.com/product/omap3530 --> on the right is a DVSDK +
Android source code for 3530....grep the codes for the above keywords...

hopefully it helps?



> >
> > Now, As I understand thus far, I have the following options (
> > requirement 3 above I will ignore, don't know how to handle it yet,
> > and assume for meanwhile that I have sysfs) :
> > 1. use suspend scheme (no runtime PM)
> >     1.a. create some kernel thread who check cpu load and will decide
> > to disable system only if its below some minimum threshold (which
> > should indicate no activity)
> >     1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
> >     with this scheme only this thread is responsible for the suspend,
> > and there is no use of the runtime PM, right ?
> >
> > 2. use runtime PM scheme :
> >     With this scheme I don't understand how some device will wake the
> > system , or doesn't it need to  ? If a driver wakes up maybe it need
> > to deliver some info to system    ?
> >
> > I think option 1 is also easier to support, what do you think about both
> ?
> >
> > Thanks!!
> > Ran
>
> Does Anyone have any suggestions and feedback on the above requirements ?
>
> Thank you,
> Ran
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140916/1afe9848/attachment-0001.html 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: suspend/resume PM criterion for application
  2014-09-17  3:16                   ` Peter Teoh
@ 2014-09-17  3:32                     ` Peter Teoh
  -1 siblings, 0 replies; 24+ messages in thread
From: Peter Teoh @ 2014-09-17  3:32 UTC (permalink / raw)
  To: Ran Shalit; +Cc: Valdis Kletnieks, linux-pm, AYAN KUMAR HALDER, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 4008 bytes --]

On Wed, Sep 17, 2014 at 11:16 AM, Peter Teoh <htmldeveloper@gmail.com>
wrote:

>
>
> On Sun, Sep 14, 2014 at 2:11 AM, Ran Shalit <ranshalit@gmail.com> wrote:
>
>> On Thu, Sep 11, 2014 at 12:24 PM, Ran Shalit <ranshalit@gmail.com> wrote:
>> > On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <
>> ayankumarh@gmail.com> wrote:
>> >> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
>> >>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>> >>>
>> >>>> 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 ?
>> >>>
>> >>> That's going to depend on your system and what processes are running.
>> >>>
>> >>> You may have an MP3 player going that doesn't take much CPU at all -
>> but
>> >>> shutting down because the user hasn't hit a button in 47 minutes will
>> probably
>> >>> irritate the user no end.  Or there may be a screensaver running that
>> takes
>> >>> twice as much CPU as the MP3 player, but is totally OK on the system
>> >>> suspending whenever the rest of the system wants it.
>> >>>
>> >>> You're going to have to look at your system design, and decide for
>> yourself
>> >>> what the criteria are.
>> >>
>> >> Please correct me if my understanding is wrong:-
>> >>
>> >> I believe that autosuspend feature (for system suspend) is not present
>> >> in kernel. I believe that there is no feature in kernel which checks
>> >> for system ( cpu, devices) inactivity and suspends the entire system.
>> >> System suspend is caused when :-
>> >> 1. the user issues a command
>> >> 2. The system receives some interrupt or event (lid closing event)
>> >> 3. There is an external process which monitors system inactivity and
>> >> suspends the system.
>> >>
>> >> For runtime suspend of a device, I believe it is the driver who has
>> >> the complete responsibility to decide when to suspend the device or
>> >> resume it.  The driver can take this decision on user intervention (eg
>> >> when user writes to   /sys/devices/<my-device>/power/* ) or when the
>> >> driver has completed servicing an interrupt and feels it has nothing
>> >> more to do, etc
>> >
>> > Thanks Vlaid, Ayan,
>> >
>> > I am a bit yet struggling for couple of days on this PM issue, and I
>> > would appreciate your continous advise.
>> > The system requirement I have is as following:
>> > 1. make everything as automatic as possible , so that there won't be
>> > any need to add any userspace application for the matter.
>> > 2. wakeup from all relevant wakeup sources
>> > 3. should not use sysfs (it should be disabled from kernel)
>> > 4. platform is OMAP3530.
>>
>
> a.   look into /arch/arm/mach-omap2 of kernel source and grep for "sleep"
> and "wakeup" functionality:   power management is just managing with the
> different frequencies of the the CPU.   as far as I can tell, once sleep,
> only uart pin can be used for waking up....not sure.
>
> b.   read this:
>
>
> http://e2e.ti.com/support/dsp/omap_applications_processors/f/447/t/30005.aspx
>
> http://www.ti.com/lit/an/slva310b/slva310b.pdf   (read page 2, which
> describe the different powerup-sequence of the CPU, "Powering-Up Sequence".
>
>
> c.   the technology brand name for omap3530 is "DVFS"....search for this
> inside the arch/arm kernel source.....you can find lots of sample codes
> there.
>
> (don't confuse with another omap CPU brand name "DeepSleep" but is PM for
> another type of omap cpu.)
>
> d.   http://www.ti.com/product/omap3530 --> on the right is a DVSDK +
> Android source code for 3530....grep the codes for the above keywords...
>
> hopefully it helps?
>
>
at the risk of missing out other files:

how about this two files:

inside arch/arm/mach-omap2:

omap-pm.h
omap-pm-noop.c

which I think provide a lot of hint for you.

[-- Attachment #1.2: Type: text/html, Size: 5911 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 24+ messages in thread

* suspend/resume PM criterion for application
@ 2014-09-17  3:32                     ` Peter Teoh
  0 siblings, 0 replies; 24+ messages in thread
From: Peter Teoh @ 2014-09-17  3:32 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Sep 17, 2014 at 11:16 AM, Peter Teoh <htmldeveloper@gmail.com>
wrote:

>
>
> On Sun, Sep 14, 2014 at 2:11 AM, Ran Shalit <ranshalit@gmail.com> wrote:
>
>> On Thu, Sep 11, 2014 at 12:24 PM, Ran Shalit <ranshalit@gmail.com> wrote:
>> > On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <
>> ayankumarh at gmail.com> wrote:
>> >> On Thu, Sep 11, 2014 at 12:55 AM,  <Valdis.Kletnieks@vt.edu> wrote:
>> >>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:
>> >>>
>> >>>> 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 ?
>> >>>
>> >>> That's going to depend on your system and what processes are running.
>> >>>
>> >>> You may have an MP3 player going that doesn't take much CPU at all -
>> but
>> >>> shutting down because the user hasn't hit a button in 47 minutes will
>> probably
>> >>> irritate the user no end.  Or there may be a screensaver running that
>> takes
>> >>> twice as much CPU as the MP3 player, but is totally OK on the system
>> >>> suspending whenever the rest of the system wants it.
>> >>>
>> >>> You're going to have to look at your system design, and decide for
>> yourself
>> >>> what the criteria are.
>> >>
>> >> Please correct me if my understanding is wrong:-
>> >>
>> >> I believe that autosuspend feature (for system suspend) is not present
>> >> in kernel. I believe that there is no feature in kernel which checks
>> >> for system ( cpu, devices) inactivity and suspends the entire system.
>> >> System suspend is caused when :-
>> >> 1. the user issues a command
>> >> 2. The system receives some interrupt or event (lid closing event)
>> >> 3. There is an external process which monitors system inactivity and
>> >> suspends the system.
>> >>
>> >> For runtime suspend of a device, I believe it is the driver who has
>> >> the complete responsibility to decide when to suspend the device or
>> >> resume it.  The driver can take this decision on user intervention (eg
>> >> when user writes to   /sys/devices/<my-device>/power/* ) or when the
>> >> driver has completed servicing an interrupt and feels it has nothing
>> >> more to do, etc
>> >
>> > Thanks Vlaid, Ayan,
>> >
>> > I am a bit yet struggling for couple of days on this PM issue, and I
>> > would appreciate your continous advise.
>> > The system requirement I have is as following:
>> > 1. make everything as automatic as possible , so that there won't be
>> > any need to add any userspace application for the matter.
>> > 2. wakeup from all relevant wakeup sources
>> > 3. should not use sysfs (it should be disabled from kernel)
>> > 4. platform is OMAP3530.
>>
>
> a.   look into /arch/arm/mach-omap2 of kernel source and grep for "sleep"
> and "wakeup" functionality:   power management is just managing with the
> different frequencies of the the CPU.   as far as I can tell, once sleep,
> only uart pin can be used for waking up....not sure.
>
> b.   read this:
>
>
> http://e2e.ti.com/support/dsp/omap_applications_processors/f/447/t/30005.aspx
>
> http://www.ti.com/lit/an/slva310b/slva310b.pdf   (read page 2, which
> describe the different powerup-sequence of the CPU, "Powering-Up Sequence".
>
>
> c.   the technology brand name for omap3530 is "DVFS"....search for this
> inside the arch/arm kernel source.....you can find lots of sample codes
> there.
>
> (don't confuse with another omap CPU brand name "DeepSleep" but is PM for
> another type of omap cpu.)
>
> d.   http://www.ti.com/product/omap3530 --> on the right is a DVSDK +
> Android source code for 3530....grep the codes for the above keywords...
>
> hopefully it helps?
>
>
at the risk of missing out other files:

how about this two files:

inside arch/arm/mach-omap2:

omap-pm.h
omap-pm-noop.c

which I think provide a lot of hint for you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140917/9170d2f8/attachment.html 

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2014-09-17  3:32 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-10 17:26 suspend/resume PM criterion for application Ran Shalit
2014-09-10 17:26 ` Ran Shalit
2014-09-10 17:59 ` Valdis.Kletnieks
2014-09-10 17:59   ` Valdis.Kletnieks at vt.edu
2014-09-10 18:23   ` Ran Shalit
2014-09-10 18:23     ` Ran Shalit
2014-09-10 18:39     ` Valdis.Kletnieks
2014-09-10 18:39       ` Valdis.Kletnieks at vt.edu
2014-09-10 18:58       ` Ran Shalit
2014-09-10 18:58         ` Ran Shalit
2014-09-10 19:25         ` Valdis.Kletnieks
2014-09-10 19:25           ` Valdis.Kletnieks at vt.edu
2014-09-10 19:31           ` Ran Shalit
2014-09-10 19:31             ` Ran Shalit
2014-09-11  5:32           ` AYAN KUMAR HALDER
2014-09-11  5:32             ` AYAN KUMAR HALDER
2014-09-11  9:24             ` Ran Shalit
2014-09-11  9:24               ` Ran Shalit
2014-09-14  6:11               ` Ran Shalit
2014-09-14  6:11                 ` Ran Shalit
2014-09-17  3:16                 ` Peter Teoh
2014-09-17  3:16                   ` Peter Teoh
2014-09-17  3:32                   ` Peter Teoh
2014-09-17  3:32                     ` Peter Teoh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.