2005-03-09 14:26:16

by Moritz Muehlenhoff

[permalink] [raw]
Subject: Average power consumption in S3?

Hi,
I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
radeontool to power-off the backlight in suspend, S3 works very well
and reliable. During S3 I've measured a power consumption of 1400
to 1500 mWh (using 512 megabytes of RAM). Is there still room for
optimization? What's the typical amount of energy required for suspend-
to-ram? From friends using iBooks with MacOS X I've heard that they
left the notebook in suspend when leaving for a week and could still
use it after return.

Cheers,
Moritz


2005-03-09 14:41:16

by Matthew Garrett

[permalink] [raw]
Subject: Re: Average power consumption in S3?

Moritz Muehlenhoff <[email protected]> wrote:

> I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
> radeontool to power-off the backlight in suspend, S3 works very well
> and reliable. During S3 I've measured a power consumption of 1400
> to 1500 mWh (using 512 megabytes of RAM). Is there still room for
> optimization? What's the typical amount of energy required for suspend-
> to-ram? From friends using iBooks with MacOS X I've heard that they
> left the notebook in suspend when leaving for a week and could still
> use it after return.

Radeons don't actually power down in D3 unless some registers are set,
and even then the kernel doesn't currently have any code that would put
the Radeon in D3. If you're willing to test something, could you try the
code at

http://www.srcf.ucam.org/~mjg59/radeon/

and do

radeontool power off

immediately before putting the machine into suspend? Make sure that you
do this from something other than X.
--
Matthew Garrett | [email protected]

2005-03-09 17:33:25

by Martin Josefsson

[permalink] [raw]
Subject: Re: Average power consumption in S3?

On Wed, 2005-03-09 at 15:26 +0100, Moritz Muehlenhoff wrote:
> Hi,
> I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
> radeontool to power-off the backlight in suspend, S3 works very well
> and reliable. During S3 I've measured a power consumption of 1400
> to 1500 mWh (using 512 megabytes of RAM). Is there still room for
> optimization? What's the typical amount of energy required for suspend-
> to-ram? From friends using iBooks with MacOS X I've heard that they
> left the notebook in suspend when leaving for a week and could still
> use it after return.

I also have an X31 and I noticed that the e1000 has Wake-On-Lan enabled
by default and the S3 code doesn't disable that (kind of defeats the
purpose :)
Disabling that will make the e1000 driver power down the chip during S3.

ethtool -s ethX wol d

I don't know if you have the e1000 or e100 in your machine, but I think
the e100 driver does the same.

I've had mine suspended for 2-3 days at most, actually havn't left it
alone for longer than that in S3 so I'm not really sure how much power
it consumes, but I'd say it's 1-2 percent of the total capacity per
hour, so somewhere below 1000mW.

I also use the standard radeontool to disable the backlight, I'll test
the version Matthew pointed out some day.

--
/Martin


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2005-03-10 17:36:00

by Moritz Muehlenhoff

[permalink] [raw]
Subject: Re: Average power consumption in S3?

Matthew Garrett wrote:
> Radeons don't actually power down in D3 unless some registers are set,
> and even then the kernel doesn't currently have any code that would put
> the Radeon in D3. If you're willing to test something, could you try the
> code at
>
> http://www.srcf.ucam.org/~mjg59/radeon/
>
> immediately before putting the machine into suspend? Make sure that you
> do this from something other than X.

This reduces power consumption from ca. 1500 to ca. 1200 mWh, so it's
already a huge improvement, but with 1.5 days of maximal suspend still
pretty far away from a week.

Cheers,
Moritz

2005-03-10 18:16:50

by Moritz Muehlenhoff

[permalink] [raw]
Subject: Re: Average power consumption in S3?

Martin Josefsson wrote:
> I also have an X31 and I noticed that the e1000 has Wake-On-Lan enabled
> by default and the S3 code doesn't disable that (kind of defeats the
> purpose :)
> Disabling that will make the e1000 driver power down the chip during S3.
>
> I've had mine suspended for 2-3 days at most, actually havn't left it
> alone for longer than that in S3 so I'm not really sure how much power
> it consumes, but I'd say it's 1-2 percent of the total capacity per
> hour, so somewhere below 1000mW.

I've got the e100 and with WOL disabled and Matthew's hacked radeontool
power consumption decreases to 970 mWh.

Cheers,
Moritz

2005-03-11 03:55:26

by Theodore Ts'o

[permalink] [raw]
Subject: Re: Average power consumption in S3?

On Thu, Mar 10, 2005 at 07:08:26PM +0100, Moritz Muehlenhoff wrote:
> I've got the e100 and with WOL disabled and Matthew's hacked radeontool
> power consumption decreases to 970 mWh.

I have a T40p, and with the following patches (versus 2.6.11) and the
following sleep script, I have power consuption down to 580 mWh.

The 05-radeonfb-Thinkpad-Power.patch will have to patched with your
specific Thinkpad model number, or booted with the force_sleep option.
See the Linux thinkpad mailing list ([email protected])
archives for more information.

Warning: The 05-radeonfb-Thinkpad-Power.patch is not quite ready for
merging, but compared to completely pathetic battery life when using
ACPI's suspend-to-memory without them, it's definitely worth it.

- Ted


Attachments:
(No filename) (781.00 B)
01-acpi-sleep-while-atomic-during-s3-resume-from-ram.patch (1.59 kB)
02-acpi-sleep-while-atomic.patch (655.00 B)
05-radeonfb-Thinkpad-Power.patch (5.11 kB)
suspend-mem (998.00 B)
Download all attachments

2005-03-11 04:57:02

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Average power consumption in S3?

On Thu, 2005-03-10 at 22:46 -0500, Theodore Ts'o wrote:
> On Thu, Mar 10, 2005 at 07:08:26PM +0100, Moritz Muehlenhoff wrote:
> > I've got the e100 and with WOL disabled and Matthew's hacked radeontool
> > power consumption decreases to 970 mWh.
>
> I have a T40p, and with the following patches (versus 2.6.11) and the
> following sleep script, I have power consuption down to 580 mWh.
>
> The 05-radeonfb-Thinkpad-Power.patch will have to patched with your
> specific Thinkpad model number, or booted with the force_sleep option.
> See the Linux thinkpad mailing list ([email protected])
> archives for more information.
>
> Warning: The 05-radeonfb-Thinkpad-Power.patch is not quite ready for
> merging, but compared to completely pathetic battery life when using
> ACPI's suspend-to-memory without them, it's definitely worth it.

Hi Ted !

Hopefully, somebody is gathering those patches. I intend to merge them
all at one point, though I can't promise it will happen before 2.6.12.

It would be good to "ping" me regulary though ;)

I've sort-of been waiting for ATI to tell me how to retreive the proper
memory register setting from the BIOS, since the code in there currently
is quite powerbook specific, and might not write the exact correct value
on all models. I suppose it works fine on yours so far, but I'd rather
have a way to know the right value ... unfortunately, they didn't reply
on this request.

Ben.


2005-03-11 17:45:09

by Theodore Ts'o

[permalink] [raw]
Subject: Re: Average power consumption in S3?

On Fri, Mar 11, 2005 at 03:51:19PM +1100, Benjamin Herrenschmidt wrote:
> I've sort-of been waiting for ATI to tell me how to retreive the proper
> memory register setting from the BIOS, since the code in there currently
> is quite powerbook specific, and might not write the exact correct value
> on all models. I suppose it works fine on yours so far, but I'd rather
> have a way to know the right value ... unfortunately, they didn't reply
> on this request.

There have been probably about 40 or 50 positive reports from people
on a wide variety of Thinkpad laptops (most generally recent models)
where it has worked. There were two that didn't, but it wasn't clear
at least to me whether they were true incompatibilities or unrelated
problems caused by old BIOS levels, et. al.

What I would suggest doing is changing the code to use a blacklist
instead of a whitelist, and make it optional with a CONFIG option that
is marked experimental, and then get it into the mainline for
additional testing. If we can get ATI to give us the right way to do
it, great, but if they aren't being responsive, maybe we should just
do it empirically.

- Ted

2005-03-11 19:40:31

by Bill Davidsen

[permalink] [raw]
Subject: Re: Average power consumption in S3?

Benjamin Herrenschmidt wrote:

> I've sort-of been waiting for ATI to tell me how to retreive the proper
> memory register setting from the BIOS, since the code in there currently
> is quite powerbook specific, and might not write the exact correct value
> on all models. I suppose it works fine on yours so far, but I'd rather
> have a way to know the right value ... unfortunately, they didn't reply
> on this request.

Any chance that it will apply to other Radeon based machines? I have an
ASUS (1681) using the 8700 chipset. At the moment suspecd doesn't work
at all, but at least somewhere in 2.6.10+ turning off the backlight
started working with the screen saver.

I guess it's better than my Dell and Toshiba laptops, which suspecnd but
don't resume :-(

--
-bill davidsen ([email protected])
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me

2005-03-11 19:59:38

by Jan De Luyck

[permalink] [raw]
Subject: Re: Average power consumption in S3?

On Wednesday 09 March 2005 15:40, Matthew Garrett wrote:
> Moritz Muehlenhoff <[email protected]> wrote:
> > I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
> > radeontool to power-off the backlight in suspend, S3 works very well
> > and reliable. During S3 I've measured a power consumption of 1400
> > to 1500 mWh (using 512 megabytes of RAM). Is there still room for
> > optimization? What's the typical amount of energy required for suspend-
> > to-ram? From friends using iBooks with MacOS X I've heard that they
> > left the notebook in suspend when leaving for a week and could still
> > use it after return.
>
> Radeons don't actually power down in D3 unless some registers are set,
> and even then the kernel doesn't currently have any code that would put
> the Radeon in D3. If you're willing to test something, could you try the
> code at
>
> http://www.srcf.ucam.org/~mjg59/radeon/
>
> and do
>
> radeontool power off
>
> immediately before putting the machine into suspend? Make sure that you
> do this from something other than X.

Small question, can this tool do what the boot-radeon tool can? That way I can
scrap another one in my suspend-to-ram tricks ;p

Jan

--
I tripped over a hole that was sticking up out of the ground.

2005-03-11 23:54:38

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Average power consumption in S3?


> What I would suggest doing is changing the code to use a blacklist
> instead of a whitelist, and make it optional with a CONFIG option that
> is marked experimental, and then get it into the mainline for
> additional testing. If we can get ATI to give us the right way to do
> it, great, but if they aren't being responsive, maybe we should just
> do it empirically.

I'm hesitant to switch a whitelist because of a couple of settings in
there that are specific to the way the chip is wired on the mobo.
Apparently, thinkpads are similar enough to Macs, but I wouldn't bet on
this beeing "commmon"...

Also, the code in there switches to D2, not D3 and is only for M6,M7 and
M9 for now. I may be able to produce code for the M10 as well based on
some dumps we did from the MacOS driver, paulus wrote something that we
ended up not using because the chip is actually powered down on Macs
with the M10.

Then, there is the problem of machines where the chip is powered down
during sleep... I can re-POST an rv280 (M9+) and an M10 but only in
"graphics" mode, not the VGA side for which I know nothing about, with
the same possible issue about video RAM mode register setting.

Ben.


2005-03-12 04:58:41

by Theodore Ts'o

[permalink] [raw]
Subject: Re: Average power consumption in S3?

On Sat, Mar 12, 2005 at 10:48:21AM +1100, Benjamin Herrenschmidt wrote:
>
> I'm hesitant to switch a whitelist because of a couple of settings in
> there that are specific to the way the chip is wired on the mobo.
> Apparently, thinkpads are similar enough to Macs, but I wouldn't bet on
> this beeing "commmon"...

If this is true, then ATI probably won't be able to tell us anything
useful, so we're only going to find out if people in the Thinkpad
division are willing to tell us something useful (and their track
record for being helpful has not been particularly stellar).

And what I was thinking about doing was having the CONFIG option only
do it for machines that were detected as being IBM Thinkpads, not all
Radeon chips. The blacklist would be for specific IBM thinkpad
models; what I'm guessing here is that it's likely that all or most
modern IBM thinkpads are going to be wired the same way on the
motherboard.

- Ted

2005-03-12 05:22:41

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Average power consumption in S3?

On Fri, 2005-03-11 at 23:58 -0500, Theodore Ts'o wrote:

> If this is true, then ATI probably won't be able to tell us anything
> useful, so we're only going to find out if people in the Thinkpad
> division are willing to tell us something useful (and their track
> record for being helpful has not been particularly stellar).
>
> And what I was thinking about doing was having the CONFIG option only
> do it for machines that were detected as being IBM Thinkpads, not all
> Radeon chips. The blacklist would be for specific IBM thinkpad
> models; what I'm guessing here is that it's likely that all or most
> modern IBM thinkpads are going to be wired the same way on the
> motherboard.

Fine with me then.