Darren Salt wrote:
I demand that Thiemo Nagel may or may not have written...
has anybody thought about including PCIe ASPM? Saves roughly 0.3 Watts on my Eee PC 1000HGO. How about lumping this together with S.H.E.?

Could do...

SHE     ASPM
0       performance
1       default
2       powersave

Older EeePCs with just the two S.H.E. states need to have one of those
omitted; I'd omit "performance".

I wonder, whether really substantial savings are achieved with ASPM. When I use a more rigorous approach to measure power consumption, the 0.3 Watts in savings that I've quoted previously cannot be held up. To the opposite: The "powersave" mode seems to use ~0.1 Watts more than the "performance" mode.

I've attached my script which does a stochastic comparison of power consumption of two different configurations (currently with and without ASPM): It's measuring (and averaging) power consumption while randomly switching to and forth between both configurations to get an unbiased sample. (That means that one can use the computer normally without disturbing the measurement.) I'd be interested what results other people get on different machines. (The most interesting value is the "tot. avg" for the two different configurations, the number of measurements "n" should be above ~100 for a good average.)

Another strange thing: From time to time, I'm seeing bursts of very unreasonable current and voltage readings, like in:

Ignoring unreasonable reading: C=1413000uA, V=37008000uV
Ignoring unreasonable reading: C=37008000uA, V=37008000uV
Ignoring unreasonable reading: C=37043000uA, V=7494000uV

powertop is getting these too, occasionally reporting >1000W of power consumption. Hardware bug or kernel bug? I'm running 2.6.31-rc3 on Eee 1000HGO.

Kind regards,

Thiemo

--
+-----------------------------------+--------------------------+
| Dipl.-Phys. Thiemo Nagel          |                          |
| Technische Universitaet Muenchen  | Room    PH1 3276         |
| Physik-Department E18             |                          |
| James-Franck-Strasse              | Phone  +49 89 289-12379  |
| D-85747 Garching                  | Fax    +49 89 289-12570  |
+-----------------------------------+--------------------------+
#! /usr/bin/perl
#
# stochastic power consumption comparison of two different configurations

use warnings;
use diagnostics;
use strict;

# commands to switch between two different states
my @cmd = ('echo performance > /sys/module/pcie_aspm/parameters/policy',
           'echo powersave > /sys/module/pcie_aspm/parameters/policy');
#my @cmd = ('echo suspend > /sys/bus/usb/devices/5-6/power/level',
#           'echo auto    > /sys/bus/usb/devices/5-6/power/level');

# maximal number of power readings between changes of states
my $interval = 5;


BEGIN {

    my $oldC = 0;
    my $oldV = 0;
    
    sub getpower() {
        
        my $C=0;
        my $V=0;
        my $p;
        while (1) {
            $C = chomp `cat /sys/class/power_supply/BAT0/current_now`;
            $V = chomp `cat /sys/class/power_supply/BAT0/voltage_now`;
            
            # avoid duplicate readings
            if ($C == $oldC && $V == $oldV) {
                sleep(1);
                next;
            }
            
            $p = 1e-12 * $C * $V;

            # avoid bad readings
            if ($p < 3 || 20 < $p) {
                print "Ignoring unreasonable reading: C=${C}uA, V=${V}uV\n"; 
                sleep(1);
                next;
            }
            
            last;
        }
        
        $oldC = $C;
        $oldV = $V;
        
        return $p;
    }
}


my @list = (
    [ (0., 0., 0., 0., 0., 0., 0., 0., 0., 0.) ],
    [ (0., 0., 0., 0., 0., 0., 0., 0., 0., 0.) ]
    );

my @sum   = (0., 0.);
my @sum2  = (0., 0.);
my @n     = (0, 0);

while (1) {

    for (my $state = 0; $state < 2; $state++) {
        print "State change: ", $cmd[$state], ": ", `$cmd[$state]`, "\n";

        # randomize interval length to avoid unlucky synchronisations with
        # periodic tasks being run on the machine
        my $max = int(rand($interval))+1;
        for (my $i = 0; $i <= $max; $i++) {
            my $p = getpower();
            next if $i==0;
            push @{$list[$state]}, $p;
            shift @{$list[$state]};

            my $avg10 = 0.;
            foreach my $v (@{$list[$state]}) { $avg10 += $v; }
            $avg10 /= scalar @{$list[$state]};

            $sum[$state]  += $p;
            $sum2[$state] += $p*$p;
            $n[$state]++;
            
            my $avg    = $sum[$state] / $n[$state];
            my $stddev = sqrt($sum2[$state] / $n[$state] - $avg*$avg);
#            printf "Sum[%i]=%.2f\n", $state, $sum[$state];
            printf "Status %i: cur: %.2fW, avg 10: %.2fW, ".
                "tot. avg: %.2fW, stddev: %.2fW (n=%i)\n",
                $state, $p, $avg10, $avg, $stddev, $n[$state];
        }
    }

}
_______________________________________________
Debian-eeepc-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-eeepc-devel

Reply via email to