Re: power management experiences with joyride-1572

2008-01-27 Thread Jordan Crouse
On 26/01/08 21:47 +, [EMAIL PROTECTED] wrote:
 On Fri, 25 Jan 2008, Richard A. Smith wrote:
 
  Chris Ball wrote:
 
 Can I wake up 10 seconds from now?  Is there a timer in any of the
 hardware that is left running?
 
 Yes, but the software does not support this yet.  See bug #4606:
 http://dev.laptop.org/ticket/4606
 
  We don't *use* the southbridge RTC wakeup, but it's not strictly true
  that we don't support it.  You can set your own wakeups easily:
 
 # rtcwake -s 120
 after 30s, the laptop should suspend due to idleness
 after another 90s, the laptop should wake itself
 
  rtcwake is in the OLPC build already.
 
  - Chris.
 
  RTC wakeups have a chance of hitting #1835 because the EC cannot prevent
  the short cycle of the control line to the voltage regulator so we don't
  use them.  Andres has discussed prohibiting RTC wakeups in kernel space
  but I suggested we put that in the don't do that category since he has
  higher priority stuff to worry about.
 
  The safe way to schedule a future wake up will be to use a EC timer.
 
  The framework for this exists but I don't have the kernel facing EC
  command plumbed yet.  This timer will allow you to schedule a wakeup
  with about 10ms resolution up to 24 days in the future.
 
 what is the shortest time that a sleep (followed by a wakeup from the EC 
 timer) can be programmed?
 
 would it make sense to hack the kernel so that if all timers are set to 
 fire more than this far in the future it wakes a user task that can decide 
 to sleep

See also 'cpuidle' [1].

Jordan

[1] - http://lwn.net/Articles/221791/


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-27 Thread Edward Cherlin
On Jan 24, 2008 5:12 PM, Tomeu Vizoso [EMAIL PROTECTED] wrote:
 On Fri, 2008-01-25 at 01:45 +0100, Ivan Krstić wrote:
  On Jan 25, 2008, at 1:31 AM, Frank Ch. Eigler wrote:
   if the all brand new XO-focused software doesn't already do this
 
  We're building a platform, and have been completely and brutally
  transparent about our progress. Software built on our platform will
  keep improving rapidly along a number of axes, power management being
  one, and even more rapidly if folks jump in and help us with the work.
  Patches welcome ;)
 
   So you may end up needing a tool that applies heuristics and
   overrides the CPU
   requests of poor programs.
 
  As an anecdote, I spend a non-trivial amount of time working in
  disconnected environments using battery power on my non-XO laptop, and
  I've been obtaining noticeable battery life gains by manually
  SIGSTOPping Firefox when not in use. Now, I usually have about 70-200
  tabs open -- which may be an edge case, but _shouldn't_ be:
  programmers need to learn that when I'm not actively using their
  software, it shouldn't be _doing_ stuff on my machine without a very
  good reason.

 Also, lots of people in the FLOSS world are realizing that their
 software needs to run on small devices (mobile/embedded
 projects/alliances etc.).

 Tomeu

As a former market analyst, I have observed that every year, somebody
is complaining about some aspect of Linux not being ready for the
world, and that every year, the community deals with it. At one time
it was said that Unix couldn't support enterprise computing, and in
particular serious databases. IBM and Oracle became excellent
counterexamples. Linux was too hard to install. Many distros worked on
it, and Ubuntu has laid that complaint to rest. Linux wasn't ready for
the desktop, however well it did on servers. Now Dell and others offer
Linux preinstalled. (I get mine from Linux Certified in Sunnyvale.)
This, that, and the other are wrong with XO software. But they soon
won't be.

This is a much more general phenomenon. At one time you couldn't get
compilers to produce relocatable code. (Really) At about that time,
you couldn't get a hard drive for a personal computer. Time marches
on, and so does the state of the art.

The Linux world is discovering time and space bloat. Since the
solutions are shared, they will be taken up at a rate astonishing to
those in the commercial world.

BTW, thanks, Ivan and everybody. I'm sending people your way at every
opportunity.

 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel




-- 
Edward Cherlin
End Poverty at a Profit by teaching children business
http://www.EarthTreasury.org/
The best way to predict the future is to invent it.--Alan Kay
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-25 Thread Richard A. Smith
Chris Ball wrote:

 Can I wake up 10 seconds from now?  Is there a timer in any of the
 hardware that is left running?
 
 Yes, but the software does not support this yet.  See bug #4606:
 http://dev.laptop.org/ticket/4606
 
 We don't *use* the southbridge RTC wakeup, but it's not strictly true
 that we don't support it.  You can set your own wakeups easily:
 
# rtcwake -s 120
after 30s, the laptop should suspend due to idleness
after another 90s, the laptop should wake itself
 
 rtcwake is in the OLPC build already.
 
 - Chris.

RTC wakeups have a chance of hitting #1835 because the EC cannot prevent 
the short cycle of the control line to the voltage regulator so we don't 
use them.  Andres has discussed prohibiting RTC wakeups in kernel space 
but I suggested we put that in the don't do that category since he has 
higher priority stuff to worry about.

The safe way to schedule a future wake up will be to use a EC timer.

The framework for this exists but I don't have the kernel facing EC 
command plumbed yet.  This timer will allow you to schedule a wakeup 
with about 10ms resolution up to 24 days in the future.

-- 
Richard Smith  [EMAIL PROTECTED]
One Laptop Per Child
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-24 Thread Frank Ch. Eigler
Chris Ball [EMAIL PROTECTED] writes:

 [...]
 In the future, we can imagine setting wakeups programmatically, with
 the help of the Linux dynamic ticks implementation and the cpuidle
 framework -- if Frank's sugar clock has a pending wakeup in 60 seconds
 to update the minute hand of the clock, we can set a wakeup for +59s
 before going to sleep.  This is a long-term feature, though.

To what extent do folks know what olpc userspace is doing in its idle
moments?  If there is not much junk system call traffic, one could
imagine a tool that monitors the processes, and when it finds that
they're all voluntarily sleeping for long enough, it could schedule
an early suspend and a later automatic resume.  i.e., if sugar clock
is doing sleep(60), but other processes are blocked on I/O, this
tool could run rtcwakeup 60; echo mem  /proc/.../suspend).

- FChE
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-24 Thread Ivan Krstić
On Jan 24, 2008, at 5:21 PM, Chris Ball wrote:
 The computer's going to be turned off a lot of the time, even when  
 it doesn't look to you like it's obviously off, and that's just  
 something people writing software for the XO will have to change the  
 way they program for.  I'm not yet sure how reasonable this answer  
 is.  :)

FWIW, I think it's the only reasonable answer.

--
Ivan Krstić [EMAIL PROTECTED] | http://radian.org

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-24 Thread Ivan Krstić
On Jan 25, 2008, at 1:31 AM, Frank Ch. Eigler wrote:
 if the all brand new XO-focused software doesn't already do this

We're building a platform, and have been completely and brutally  
transparent about our progress. Software built on our platform will  
keep improving rapidly along a number of axes, power management being  
one, and even more rapidly if folks jump in and help us with the work.  
Patches welcome ;)

 So you may end up needing a tool that applies heuristics and  
 overrides the CPU
 requests of poor programs.

As an anecdote, I spend a non-trivial amount of time working in  
disconnected environments using battery power on my non-XO laptop, and  
I've been obtaining noticeable battery life gains by manually  
SIGSTOPping Firefox when not in use. Now, I usually have about 70-200  
tabs open -- which may be an edge case, but _shouldn't_ be:  
programmers need to learn that when I'm not actively using their  
software, it shouldn't be _doing_ stuff on my machine without a very  
good reason.

--
Ivan Krstić [EMAIL PROTECTED] | http://radian.org

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-24 Thread Martin Langhoff
On Jan 25, 2008 2:12 PM, Tomeu Vizoso [EMAIL PROTECTED] wrote:
 Also, lots of people in the FLOSS world are realizing that their
 software needs to run on small devices (mobile/embedded
 projects/alliances etc.).

OLPC and powertop are making that very visible, and people are
learning/reacting pretty well. Within a few weeks of powertop being
released, the worst offenders in most distros had been fixed -- I was
amazed. The fixes took a while to percolate, but on a current linux
distro, laptop gets a lot more battery life (~50%) than 1 year ago
now.

Alas, memory use is a harder one...


martin
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-24 Thread Ivan Krstić
On Jan 25, 2008, at 1:54 AM, Frank Ch. Eigler wrote:
 Please don't interpret this concern as a criticism of what's been
 accomplished.

I didn't. My point was that you shouldn't yet judge too much from the  
software we ship not behaving as well as it should about power  
management.

 That's exactly the sort of heuristic that an XO power boss tool could
 apply.  A tool with such heuristics may well be easier to construct
 than fixes for all of userspace.


Certainly, though I suspect we'll also end up providing nicer ways for  
platform-aware programs to perform savings in tandem with Sugar.

--
Ivan Krstić [EMAIL PROTECTED] | http://radian.org

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


power management experiences with joyride-1572

2008-01-23 Thread Frank Ch. Eigler
Hi -

I've been dabbling with joyride-1572 on a g1g1 laptop for a day or
few, and have noticed the suspend feature kick in after a few seconds
of apparent inactivity.  I have some questions about whether some
specific experiences with this are expected:

- that a resume operation begins only with a keyboard/touchpad input,
and takes 1-2 seconds for interactiveness to return?

- that running programs such as the sugar clock widget, or programs
running in the sugar terminal, all freeze during the suspend?

- that if one switches to the text console (C-A-F1), one observes the
backlight intensity oscillate up  down with about a 10s interval,
despite ongoing keyboard input?

- that power consumption during the awake mode has not significantly
fallen since build-650 or -653, leading to a ~3 hour battery endurance
for light continuous web browsing / terminal usage?

Thanks!

- FChE
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-23 Thread Chris Ball
Hi Frank,

Hi - I've been dabbling with joyride-1572 on a g1g1 laptop for a
day or few, and have noticed the suspend feature kick in after a
few seconds of apparent inactivity.  I have some questions about
whether some specific experiences with this are expected:

- that a resume operation begins only with a keyboard/touchpad
input, and takes 1-2 seconds for interactiveness to return?

Yes, the resume operation is triggered by user input, or a wireless
packet addressed to the host (or some battery-related events).  It
can't be triggered by anything in software unless that's organized
ahead of time; the CPU is turned off completely in the suspend mode.

We're going to be spending a lot of effort on decreasing that resume
time.  We've measured it at 280ms with USB and some other drivers turned
off, but as you say we're above 1 second with the current setup.  We
need to perform a mix of:

   * optimizing driver resume
   * parallelizing driver resume
   * delaying driver resume until the device is needed

wherever possible until we're back around the first number.  So far
we've been working on making it work rather than making it fast; that
will start to change with our next release.

- that running programs such as the sugar clock widget, or programs
running in the sugar terminal, all freeze during the suspend?

Correct.  Note that if a program running in the sugar terminal is using
non-trivial CPU, it will inhibit suspend by doing so; an automatic
suspend should never happen while a compile is underway, for example.
When in suspend, (approximately) everything except the screen/wireless
is turned off, hence the freeze.  This is why we avoid such
constantly-updating applets on the sugar home screen.

- that if one switches to the text console (C-A-F1), one observes
the backlight intensity oscillate up  down with about a 10s
interval, despite ongoing keyboard input?

That's a bug, since fixed in later builds.

- that power consumption during the awake mode has not
significantly fallen since build-650 or -653, leading to a ~3 hour
battery endurance for light continuous web browsing / terminal
usage?

Correct, we haven't changed power consumption while everything is turned
on.  We're working instead on turning a lot of things off where possible.
I'd be very interested to hear real-life experiences of battery life
with the mix of awake and asleep modes currently present in the Joyride
build.  I'd also be interested in opinions on the timeouts I've chosen
for the idle-suspend mode -- currently we suspend after 30 seconds of
user input idleness, if the CPU is also idle.

Thanks,

- Chris.
-- 
Chris Ball   [EMAIL PROTECTED]
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-23 Thread Benjamin M. Schwartz
On Wed, 2008-01-23 at 11:47 -0800, Hal Murray wrote:
  Yes, the resume operation is triggered by user input, or a wireless
  packet addressed to the host (or some battery-related events).  It
  can't be triggered by anything in software unless that's organized
  ahead of time; the CPU is turned off completely in the suspend mode. 
 
 What does organized ahead of time mean?
 
 Can I wake up 10 seconds from now?  Is there a timer in any of the hardware 
 that is left running?

Yes, but the software does not support this yet.  See bug #4606:
http://dev.laptop.org/ticket/4606



___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-23 Thread Chas. Owens
On Jan 23, 2008 2:47 PM, Hal Murray [EMAIL PROTECTED] wrote:

  Yes, the resume operation is triggered by user input, or a wireless
  packet addressed to the host (or some battery-related events).  It
  can't be triggered by anything in software unless that's organized
  ahead of time; the CPU is turned off completely in the suspend mode.

 What does organized ahead of time mean?

 Can I wake up 10 seconds from now?  Is there a timer in any of the hardware
 that is left running?
snip

On most hardware, yes.  It is more of a clock than a timer.  You can
preset a specific time to wake-up the machine (say 0900 when you are
showing up at work).  I can't say for certain that the XO-1 has this
ability though.
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-23 Thread Chris Ball
Hi,

What does organized ahead of time mean?

Setting a wakeup timer before going to sleep.

Can I wake up 10 seconds from now?  Is there a timer in any of the
hardware that is left running?

There are two timers left running.  There is the Geode southbridge RTC,
which can set a wakeup to one-second resolution (but not sub-second)
using the standard Linux RTC device interface.  There is also the EC,
which has just gained the same ability but without the limitation of
having to set wakeups on second boundaries.  I suspect that we will
start to use the EC timer in the next feature release of the software.

In the future, we can imagine setting wakeups programmatically, with
the help of the Linux dynamic ticks implementation and the cpuidle
framework -- if Frank's sugar clock has a pending wakeup in 60 seconds
to update the minute hand of the clock, we can set a wakeup for +59s
before going to sleep.  This is a long-term feature, though.

- Chris.
-- 
Chris Ball   [EMAIL PROTECTED]
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: power management experiences with joyride-1572

2008-01-23 Thread Chris Ball
Hi,

Can I wake up 10 seconds from now?  Is there a timer in any of the
hardware that is left running?

Yes, but the software does not support this yet.  See bug #4606:
http://dev.laptop.org/ticket/4606

We don't *use* the southbridge RTC wakeup, but it's not strictly true
that we don't support it.  You can set your own wakeups easily:

   # rtcwake -s 120
   after 30s, the laptop should suspend due to idleness
   after another 90s, the laptop should wake itself

rtcwake is in the OLPC build already.

- Chris.
-- 
Chris Ball   [EMAIL PROTECTED]
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel