Re: Fwd: XO 1.5 frequency scaling

2010-05-08 Thread Tiago Marques
> you're right.  there's nothing in powerd related to clocking.  powerd
> limits itself to managing the display, wlan on/off, and system suspend.
>

Seemed so, thanks.

>
>  > Did I miss some firmware or kernel update, as I can't load the c7
powersaver
>  > kernel module in a kernel I built myself.
>
> are you sure you're running the kernel you built?  (i.e., it, and
> whatever symlinks it needs to vmlinuz, need to be in /boot and
> /bootpart/boot.)

Yup, I'm not running it over Fedora but on Gentoo in an external HDD.
Some patch missing in the kernel perhaps?

Best regards,
Tiago

>
> paul
>
>  >
>  >
>  > >
>  > > ==
>  > > I spent the day/night today working on getting our C states and P
states
>  > > enabled.
>  > >
>  > > The good news is that I got C4,C5 and frequency/voltage scaling (P
>  > > states) working.
>  > >
>  > > The bad news is that C5 causes memory corruption and P states don't
help
>  > > much.
>  > >
>  > > Enabling C4 seems to save us about 170mW in idle.
>  > >
>  >
>  > Any measurement on how low it goes in C4?
>  >
>  >
>  > >
>  > > C5 should save us a bit more but with it enabled the system won't
boot.
>  > > It gets all sorts of funky ext4 errors.  C5 turns off the L2 cache
and
>  > > the docs say you should flush before entering.  I suspect thats not
>  > > happening.
>  > >
>  > > P states currently don't seem to save us enough to be measured.  One
>  > > reason is that our core voltage is set by default to be very close to
>  > > the minimum.  Its at .796V and the minimum is .7V with scaling
enabled
>  > > (+ code hack) the minimum setting drops Vcore to .73V. Its supposed
to
>  > > go to .7 but the volt meter says otherwise.  60mV diff doesn't offer
a
>  > > whole lot of savings.
>  > >
>  >
>  > I see, I thought they could drop it even further.
>  >
>  >
>  > >
>  > > The CPU frequency slides between 400Mhz and 1GHz and you would think
>  > > that it would make a large difference but the meter says otherwise.
 How
>  > > can that be you ask?  The answer is because Linux issues a hlt when
>  > > idle.  If you run the test under OFW then you can create up to 1.5W
of
>  > > power difference by sliding the freq from min to max [1] and holding
the
>  > > Vcore constant.  But in idle not so much.  The processor already does
a
>  > > very good job of gating the clocks.
>  > >
>  > >
>  > Nice, kudos for VIA.
>  >
>  >
>  > > So this brings us back to what we already knew.  The big money on
power
>  > > savings is in our special sauce idle suspend.
>  > >
>  > > [1] Turns out you can overclock the processor.  Via lists the max
>  > > multiplier at 16x FSB (100Mhz) which is 1.6Ghz even though its listed
as
>  > > a max of 1Ghz. However if you continue to put values into the
multiplier
>  > > register the power draw continues to increase.  I stopped when the
>  > > system draw had hit 9W cause the XO on the power meter does not have
a
>  > > heat spreader and I didn't want to take the chance of burning it up.
>  > > =
>  > >
>  >
>  > The heatspreader I can hack with a heatpipe and some coolers, I'm going
to
>  > do it anyway since it is already going to 85ºC in load. The speed is
of some
>  > use to me most of the time, I'm just worried that the VRM can't handle
the
>  > extra current.
>  >
>  > Best regards,
>  > Tiago
>  >
>  >
>  > >
>  > > --
>  > >
>  > > Richard A. Smith  
>  > > One Laptop per Child
>  > > ___
>  > > Devel mailing list
>  > > Devel@lists.laptop.org
>  > > http://lists.laptop.org/listinfo/devel
>  > >
>  > part 2 text/plain 129
>  > ___
>  > Devel mailing list
>  > Devel@lists.laptop.org
>  > http://lists.laptop.org/listinfo/devel
>
> =-
>  paul fox, p...@laptop.org
>
> ___
> Devel mailing list
> Devel@lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Fwd: XO 1.5 frequency scaling

2010-05-08 Thread Paul Fox
tiago wrote:
 > -- Forwarded message --
 > From: Tiago Marques 
 > Date: Sat, May 8, 2010 at 12:17 PM
 > Subject: Re: XO 1.5 frequency scaling
 > To: "Richard A. Smith" 
 > 
 > 
 > Hi Richard,
 > 
 > On Wed, May 5, 2010 at 12:28 AM, Richard A. Smith wrote:
 > 
 > > On 05/04/2010 07:01 PM, Tiago Marques wrote:
 > >
 > > > Let me see if I understand what you said. I understand how it works on
 > > > desktop and regular laptops. You load the module for the specific power
 > > > saving feature and either a kernel module to do the job or the userspace
 > > > module which then allows a daemon to do the frequency scaling.
 > > > Now the XO 1.5, AFAIK, isn't doing it or powerd is doing it(or openfw).
 > > > I tried loading the C7 power saver module but it can't find the device.
 > > > Is it already being taken and should I not worry with frequency scaling
 > > > although /proc/cpuinfo always shows 1000MHz?
 > >
 > > The module is not enabled in the kernel build and in our case appears to
 > > only offer saving in very limited cases.  Yes, you could cap your max
 > > frequency and max power draw but in general you end up using more
 > > power*time that way because you keep all the other components that don't
 > > have sort of power scaling up longer then they would have been because
 > > it takes longer to do the task.  If you decrease the power draw 2x but
 > > then extend the time 2x you have gained nothing.
 > >
 > >
 > Not my experience, but I'm desktop biased I guess. I was thinking that you
 > could further lower the core voltage on the XO and get something like 50%
 > the clock with 25% or less power. But, as you describe below, if VIA managed
 > such an agressive power gating, it's the way to go.
 > 
 > 
 > > Feel free to experiment though.  The latest versions of powerd have
 > > power logging built in and if you want a more specific measurement my
 > > power logging scripts should be useful.
 > >
 > > IIRC I had to hack on the driver a bit to make it work.  The following
 > > is a summary email I posted from when I worked on it.
 > >
 > > Notes:
 > > - Ignore the comment about C5. Our CPU does not support C5.
 > >
 > > - Ignore the comment about being scared to burn up the CPU.  We now have
 > > thermal throttling enabled and have tested it extensively. Unless you
 > > turn that off you should not be able to burn up the CPU.
 > >
 > 
 > This is on olpc-powerd or the VIA C7 powersaver driver? I couldn't find
 > anything related to over/underclocking in powerd.

you're right.  there's nothing in powerd related to clocking.  powerd
limits itself to managing the display, wlan on/off, and system suspend.


 > Did I miss some firmware or kernel update, as I can't load the c7 powersaver
 > kernel module in a kernel I built myself.

are you sure you're running the kernel you built?  (i.e., it, and
whatever symlinks it needs to vmlinuz, need to be in /boot and
/bootpart/boot.)

paul

 > 
 > 
 > >
 > > ==
 > > I spent the day/night today working on getting our C states and P states
 > > enabled.
 > >
 > > The good news is that I got C4,C5 and frequency/voltage scaling (P
 > > states) working.
 > >
 > > The bad news is that C5 causes memory corruption and P states don't help
 > > much.
 > >
 > > Enabling C4 seems to save us about 170mW in idle.
 > >
 > 
 > Any measurement on how low it goes in C4?
 > 
 > 
 > >
 > > C5 should save us a bit more but with it enabled the system won't boot.
 > > It gets all sorts of funky ext4 errors.  C5 turns off the L2 cache and
 > > the docs say you should flush before entering.  I suspect thats not
 > > happening.
 > >
 > > P states currently don't seem to save us enough to be measured.  One
 > > reason is that our core voltage is set by default to be very close to
 > > the minimum.  Its at .796V and the minimum is .7V with scaling enabled
 > > (+ code hack) the minimum setting drops Vcore to .73V. Its supposed to
 > > go to .7 but the volt meter says otherwise.  60mV diff doesn't offer a
 > > whole lot of savings.
 > >
 > 
 > I see, I thought they could drop it even further.
 > 
 > 
 > >
 > > The CPU frequency slides between 400Mhz and 1GHz and you would think
 > > that it would make a large difference but the meter says otherwise.  How
 > > can that be you ask?  The answer is because Linux issues a hlt when
 > > idle.  If you run the test under OFW then you can c

Fwd: XO 1.5 frequency scaling

2010-05-08 Thread Tiago Marques
-- Forwarded message --
From: Tiago Marques 
Date: Sat, May 8, 2010 at 12:17 PM
Subject: Re: XO 1.5 frequency scaling
To: "Richard A. Smith" 


Hi Richard,

On Wed, May 5, 2010 at 12:28 AM, Richard A. Smith wrote:

> On 05/04/2010 07:01 PM, Tiago Marques wrote:
>
> > Let me see if I understand what you said. I understand how it works on
> > desktop and regular laptops. You load the module for the specific power
> > saving feature and either a kernel module to do the job or the userspace
> > module which then allows a daemon to do the frequency scaling.
> > Now the XO 1.5, AFAIK, isn't doing it or powerd is doing it(or openfw).
> > I tried loading the C7 power saver module but it can't find the device.
> > Is it already being taken and should I not worry with frequency scaling
> > although /proc/cpuinfo always shows 1000MHz?
>
> The module is not enabled in the kernel build and in our case appears to
> only offer saving in very limited cases.  Yes, you could cap your max
> frequency and max power draw but in general you end up using more
> power*time that way because you keep all the other components that don't
> have sort of power scaling up longer then they would have been because
> it takes longer to do the task.  If you decrease the power draw 2x but
> then extend the time 2x you have gained nothing.
>
>
Not my experience, but I'm desktop biased I guess. I was thinking that you
could further lower the core voltage on the XO and get something like 50%
the clock with 25% or less power. But, as you describe below, if VIA managed
such an agressive power gating, it's the way to go.


> Feel free to experiment though.  The latest versions of powerd have
> power logging built in and if you want a more specific measurement my
> power logging scripts should be useful.
>
> IIRC I had to hack on the driver a bit to make it work.  The following
> is a summary email I posted from when I worked on it.
>
> Notes:
> - Ignore the comment about C5. Our CPU does not support C5.
>
> - Ignore the comment about being scared to burn up the CPU.  We now have
> thermal throttling enabled and have tested it extensively. Unless you
> turn that off you should not be able to burn up the CPU.
>

This is on olpc-powerd or the VIA C7 powersaver driver? I couldn't find
anything related to over/underclocking in powerd.
Did I miss some firmware or kernel update, as I can't load the c7 powersaver
kernel module in a kernel I built myself.


>
> ==
> I spent the day/night today working on getting our C states and P states
> enabled.
>
> The good news is that I got C4,C5 and frequency/voltage scaling (P
> states) working.
>
> The bad news is that C5 causes memory corruption and P states don't help
> much.
>
> Enabling C4 seems to save us about 170mW in idle.
>

Any measurement on how low it goes in C4?


>
> C5 should save us a bit more but with it enabled the system won't boot.
> It gets all sorts of funky ext4 errors.  C5 turns off the L2 cache and
> the docs say you should flush before entering.  I suspect thats not
> happening.
>
> P states currently don't seem to save us enough to be measured.  One
> reason is that our core voltage is set by default to be very close to
> the minimum.  Its at .796V and the minimum is .7V with scaling enabled
> (+ code hack) the minimum setting drops Vcore to .73V. Its supposed to
> go to .7 but the volt meter says otherwise.  60mV diff doesn't offer a
> whole lot of savings.
>

I see, I thought they could drop it even further.


>
> The CPU frequency slides between 400Mhz and 1GHz and you would think
> that it would make a large difference but the meter says otherwise.  How
> can that be you ask?  The answer is because Linux issues a hlt when
> idle.  If you run the test under OFW then you can create up to 1.5W of
> power difference by sliding the freq from min to max [1] and holding the
> Vcore constant.  But in idle not so much.  The processor already does a
> very good job of gating the clocks.
>
>
Nice, kudos for VIA.


> So this brings us back to what we already knew.  The big money on power
> savings is in our special sauce idle suspend.
>
> [1] Turns out you can overclock the processor.  Via lists the max
> multiplier at 16x FSB (100Mhz) which is 1.6Ghz even though its listed as
> a max of 1Ghz. However if you continue to put values into the multiplier
> register the power draw continues to increase.  I stopped when the
> system draw had hit 9W cause the XO on the power meter does not have a
> heat spreader and I didn't want to take the chance of burning it up.
> =
>

The heatspreader I can hack with a heatpipe an

Re: XO 1.5 frequency scaling

2010-05-08 Thread Tiago Marques
On Wed, May 5, 2010 at 12:38 AM, Paul Fox  wrote:

> martin wrote:
>  >
>  > Running powertop on your machine is hugely informational once you've
>  > read the powertop website docs.
>
> re: powertop -- with silbe's help our battery driver now provides
> enough of the expected properties under /sys to let powertop make
> crude power measurements [1].  you have to build from their svn,
> though, because of a bug that's not normally exposed on machines
> using the ACPI driver.  (to clarify -- i have the fix -- it's not
> in their svn repo yet -- i need to send it in.)
>
> but as richard implied, a tool like powertop won't help you tune
> your laptop much, since it only measures what happens when it's
> running.  we save so much power with aggressive S3 that the changes
> from P-states, and to some extent C-states, are in the noise.
>

I see, cool. I must say I'm very surprised by how long the XO 1.5 can hold
the battery when it's suspended. I have yet to mod my B2 with the wireless
ECO and since it always turns off wireless when suspended IIRC it used like
12% of the battery while suspended for 8 hours. Must check this again, it
seemed too good to be true and a great work on the power management details!

Best regards,
Tiago


>
> paul
> [1] richard's logs and tools are far more informative, but it's
> fun watching the powertop numbers change.
> =-
>  paul fox, p...@laptop.org
> ___
> Devel mailing list
> Devel@lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: XO 1.5 frequency scaling

2010-05-04 Thread Paul Fox
martin wrote:
 > 
 > Running powertop on your machine is hugely informational once you've
 > read the powertop website docs.

re: powertop -- with silbe's help our battery driver now provides
enough of the expected properties under /sys to let powertop make
crude power measurements [1].  you have to build from their svn,
though, because of a bug that's not normally exposed on machines
using the ACPI driver.  (to clarify -- i have the fix -- it's not
in their svn repo yet -- i need to send it in.)

but as richard implied, a tool like powertop won't help you tune
your laptop much, since it only measures what happens when it's
running.  we save so much power with aggressive S3 that the changes
from P-states, and to some extent C-states, are in the noise.

paul
[1] richard's logs and tools are far more informative, but it's
fun watching the powertop numbers change.
=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: XO 1.5 frequency scaling

2010-05-04 Thread Richard A. Smith
On 05/04/2010 07:01 PM, Tiago Marques wrote:

> Let me see if I understand what you said. I understand how it works on
> desktop and regular laptops. You load the module for the specific power
> saving feature and either a kernel module to do the job or the userspace
> module which then allows a daemon to do the frequency scaling.
> Now the XO 1.5, AFAIK, isn't doing it or powerd is doing it(or openfw).
> I tried loading the C7 power saver module but it can't find the device.
> Is it already being taken and should I not worry with frequency scaling
> although /proc/cpuinfo always shows 1000MHz?

The module is not enabled in the kernel build and in our case appears to 
only offer saving in very limited cases.  Yes, you could cap your max 
frequency and max power draw but in general you end up using more 
power*time that way because you keep all the other components that don't 
have sort of power scaling up longer then they would have been because 
it takes longer to do the task.  If you decrease the power draw 2x but 
then extend the time 2x you have gained nothing.

Feel free to experiment though.  The latest versions of powerd have 
power logging built in and if you want a more specific measurement my 
power logging scripts should be useful.

IIRC I had to hack on the driver a bit to make it work.  The following 
is a summary email I posted from when I worked on it.

Notes:
- Ignore the comment about C5. Our CPU does not support C5.

- Ignore the comment about being scared to burn up the CPU.  We now have 
thermal throttling enabled and have tested it extensively. Unless you 
turn that off you should not be able to burn up the CPU.

==
I spent the day/night today working on getting our C states and P states 
enabled.

The good news is that I got C4,C5 and frequency/voltage scaling (P 
states) working.

The bad news is that C5 causes memory corruption and P states don't help 
much.

Enabling C4 seems to save us about 170mW in idle.

C5 should save us a bit more but with it enabled the system won't boot. 
It gets all sorts of funky ext4 errors.  C5 turns off the L2 cache and 
the docs say you should flush before entering.  I suspect thats not 
happening.

P states currently don't seem to save us enough to be measured.  One 
reason is that our core voltage is set by default to be very close to 
the minimum.  Its at .796V and the minimum is .7V with scaling enabled 
(+ code hack) the minimum setting drops Vcore to .73V. Its supposed to 
go to .7 but the volt meter says otherwise.  60mV diff doesn't offer a 
whole lot of savings.

The CPU frequency slides between 400Mhz and 1GHz and you would think 
that it would make a large difference but the meter says otherwise.  How 
can that be you ask?  The answer is because Linux issues a hlt when 
idle.  If you run the test under OFW then you can create up to 1.5W of 
power difference by sliding the freq from min to max [1] and holding the 
Vcore constant.  But in idle not so much.  The processor already does a 
very good job of gating the clocks.

So this brings us back to what we already knew.  The big money on power 
savings is in our special sauce idle suspend.

[1] Turns out you can overclock the processor.  Via lists the max 
multiplier at 16x FSB (100Mhz) which is 1.6Ghz even though its listed as 
a max of 1Ghz. However if you continue to put values into the multiplier 
register the power draw continues to increase.  I stopped when the 
system draw had hit 9W cause the XO on the power meter does not have a 
heat spreader and I didn't want to take the chance of burning it up.
=

-- 
Richard A. Smith  
One Laptop per Child
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: XO 1.5 frequency scaling

2010-05-04 Thread Martin Langhoff
On Tue, May 4, 2010 at 7:01 PM, Tiago Marques  wrote:
> Let me see if I understand what you said. I understand how it works on
> desktop and regular laptops. You load the module for the specific power
> saving feature and either a kernel module to do the job

I am far from being a true expert in the topic, but I think your
understanding dates back to an earlier era. Do read the LWN writeup
(should get out of paywall today/tomorrow)
http://lwn.net/Articles/384146/ -- also the website where powertop is
hosted/discussed has excellent info.

Running powertop on your machine is hugely informational once you've
read the powertop website docs.

> Now the XO 1.5, AFAIK, isn't doing it

the kernel is doing its part, and powerd is doing the other part...

hth,

m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: XO 1.5 frequency scaling

2010-05-04 Thread Tiago Marques
Hi Martin,

On Tue, May 4, 2010 at 3:09 PM, Martin Langhoff
wrote:

> On Mon, May 3, 2010 at 7:41 PM, Tiago Marques  wrote:
> > I have been wondering for some time how are you controlling the frequency
> of
> > the C7 processor in Fedora. Is this being done in the background by
>
> LWN recently did a nice post on "idle". That should give you good
> background info.


Let me see if I understand what you said. I understand how it works on
desktop and regular laptops. You load the module for the specific power
saving feature and either a kernel module to do the job or the userspace
module which then allows a daemon to do the frequency scaling.
Now the XO 1.5, AFAIK, isn't doing it or powerd is doing it(or openfw). I
tried loading the C7 power saver module but it can't find the device. Is it
already being taken and should I not worry with frequency scaling although
/proc/cpuinfo always shows 1000MHz?


> AIUI, the job is mainly in the kernel and CPU. Outside of that, powerd
> controls aggressive suspend which is actually suspend that happens so
> fast (or should happen so fast) that the user doesn't notice -- just
> like your mobile phone does.
>

That's definitely working as advertised and with a top notch response time
:)
Great work!

Best regards,
Tiago



>
> cheers,
>
>
>
> m
> --
>  martin.langh...@gmail.com
>  mar...@laptop.org -- School Server Architect
>  - ask interesting questions
>  - don't get distracted with shiny stuff  - working code first
>  - http://wiki.laptop.org/go/User:Martinlanghoff
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: XO 1.5 frequency scaling

2010-05-04 Thread Martin Langhoff
On Mon, May 3, 2010 at 7:41 PM, Tiago Marques  wrote:
> I have been wondering for some time how are you controlling the frequency of
> the C7 processor in Fedora. Is this being done in the background by

LWN recently did a nice post on "idle". That should give you good
background info.

AIUI, the job is mainly in the kernel and CPU. Outside of that, powerd
controls aggressive suspend which is actually suspend that happens so
fast (or should happen so fast) that the user doesn't notice -- just
like your mobile phone does.

cheers,



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


XO 1.5 frequency scaling

2010-05-03 Thread Tiago Marques
Hi all,

I have been wondering for some time how are you controlling the frequency of
the C7 processor in Fedora. Is this being done in the background by
openfirmware or some other place where it is not visible. I would like to
test it's effect on battery life and to know if power management needs to be
done in another way for other distros.

Also, similarly to the XO 1, can one do something with openfirmware to test
overclocking and not just underclocking, as has been mentioned in some
previous e-mails.

Best regards,
Tiago
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel