Re: [linux-pm] [RFC] sleepy linux



Hi,
On Wed, 2007-12-26 at 00:07 +0100, ext Pavel Machek wrote:
This is RFC. It does not even work for me... it sleeps but it will not
wake up, because SATA wakeup code is missing. Code attached for illustration.

I wonder if this is the right approach? What is right interface to the
drivers?


Sleepy Linux
~~~~~~~~~~~~

Copyright 2007 Pavel Machek <pavel@xxxxxxx>
GPLv2

Current Linux versions can enter suspend-to-RAM just fine, but only
can do it on explicit request. But suspend-to-RAM is important, eating
something like 10% of power needed for idle system. Starting suspend
manually is not too convinient; it is not an option on multiuser
machine, and even on single user machine, some things are not easy:

1) Download this big chunk in mozilla, then go to sleep

2) Compile this, then go to sleep

Why can't these cases be based on CPUIdle?

3) You can sleep now, but wake me up in 8:30 with mp3 player

This is about setting up properly the wakeup sources which means:

- the wakeup source is really capable of generating wakeups for the
target idle state

- the wakeup source is not actually capable of genrating wakeups from
the target idle state, which can be solved in 2 ways:

- if the duration of the activity is known, set up an alarm
(assuming alarms are proper wakeup sources) so that the
system is ready just in time, in a less efficient but more
responsive power saving state

- if the duration of the activity is unknown choose the more
efficient amongst the following solutions:

- go to deep sleep state and periodically wakeup and
poll, with a period compatible with the timing
of the event source

- prevent too deep sleep states till the event happens

Todays hardware is mostly capable of doing better: with correctly set
up wakeups, machine can sleep and successfully pretend it is not
sleeping -- by waking up whenever something interesting happens. Of
course, it is easier on machines not connected to the network, and on
notebook computers.

It might be that some hw doesn't provide deep power saving state for
some devices, but if the only missing feature is the wakeup capability,
it could be effectively replaced by some HW timer.


Requirements:

0) Working suspend-to-RAM, with kernel being able to bring video back.

1) RTC clock that can wake up system

2) Lid that can wake up a system,
or keyboard that can wake up system and does not loose keypress
or special screensaver setup

3) Network card that is either down
or can wake up system on any packet (and not loose too many packets)

These are just few system specific case, but if you start including USB
devices, the situation is going to get quite complicated very soon, if
you explicitly include certain HW devices in your model.


--
Cheers, Igor

Igor Stoppa <igor.stoppa@xxxxxxxxx>
(Nokia Multimedia - CP - OSSO / Helsinki, Finland)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: USB suspend/remote wakeup on Vista vs. XP
    ... Ditto - I was also waking the system from sleep earlier with a mouse click, ... device won't wake from Sleep though, ... Still can't get the full wait-wake wakeup, however, which is my key problem ... I would think that the hub needn't independently ...
    (microsoft.public.development.device.drivers)
  • Re: [linux-pm] [RFC] PCI: Runtime power management
    ... device supports runtime wakeup and test that as well when doing ... and not to be able to wake up the system from sleep states. ...
    (Linux-Kernel)
  • Re: [PATCH v3] wait: prevent waiter starvation in __wait_on_bit_lock
    ... running, the wake up is a nop, the!test_bitis false and noone ... Yes we have the barriers on the "wakeup", ... it will wake up us if we are at the front of the waitqueue. ...
    (Linux-Kernel)
  • Re: Fine-grained condvar/eventcount
    ... c.v., that would still be a spurious wakeup, despte it having received ... order to ensure that the thread does wake up whenever it is supposed ... set of spurious wake-ups. ... In other words, in the special case of the POSIX world, a "spurious ...
    (comp.programming.threads)