Saturday, April 25, 2009

Saving power with Linux

  1. Install cpufrequtils in Mandriva
    urpmi cpufrequtils

    lsmod | grep cpufreq_ondemand
    if nothing shows up, run
    modprobe cpufreq_ondemand

    echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
    echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
    echo hpet > /sys/devices/system/clocksource/clocksource0/current_clocksource
    echo 5 > /proc/sys/vm/laptop_mode
    echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
    echo min_power > /sys/class/scsi_host/host0/link_power_management_policy


    powertop


  2. cpufreq-info for Pentium-4 2.4C CPU after modprobe p4_clockmod:
    cpufrequtils 003: cpufreq-info (C) Dominik Brodowski 2004-2006
    Report errors and bugs to cpufreq@lists.linux.org.uk, please.
    analyzing CPU 0:
    driver: p4-clockmod
    CPUs which need to switch frequency at the same time: 0
    hardware limits: 300 MHz - 2.40 GHz
    available frequency steps: 300 MHz, 600 MHz, 900 MHz, 1.20 GHz, 1.50 GHz, 1.80 GHz, 2.10 GHz, 2.40 GHz
    available cpufreq governors: ondemand, conservative, powersave, userspace, performance
    current policy: frequency should be within 300 MHz and 2.40 GHz.
    The governor "performance" may decide which speed to use
    within this range.
    current CPU frequency is 2.40 GHz (asserted by call to hardware)
  3. cpufreq-info for Celeron E1400 CPU after modprobe acpi-cpufreq:
    cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006
    Report errors and bugs to cpufreq@vger.kernel.org, please.
    analyzing CPU 0:
    driver: acpi-cpufreq
    CPUs which need to switch frequency at the same time: 0
    hardware limits: 1.20 GHz - 2.00 GHz
    available frequency steps: 2.00 GHz, 1.60 GHz, 1.20 GHz
    available cpufreq governors: ondemand, conservative, powersave, userspace, performance
    current policy: frequency should be within 1.20 GHz and 2.00 GHz.
    The governor "ondemand" may decide which speed to use
    within this range.
    current CPU frequency is 1.20 GHz (asserted by call to hardware).
    cpufreq stats: 2.00 GHz:0.00%, 1.60 GHz:0.00%, 1.20 GHz:0.00% (1)
    analyzing CPU 1:
    driver: acpi-cpufreq
    CPUs which need to switch frequency at the same time: 1
    hardware limits: 1.20 GHz - 2.00 GHz
    available frequency steps: 2.00 GHz, 1.60 GHz, 1.20 GHz
    available cpufreq governors: ondemand, conservative, powersave, userspace, performance
    current policy: frequency should be within 1.20 GHz and 2.00 GHz.
    The governor "ondemand" may decide which speed to use
    within this range.
    current CPU frequency is 1.20 GHz (asserted by call to hardware).
    cpufreq stats: 2.00 GHz:0.00%, 1.60 GHz:0.00%, 1.20 GHz:0.00% (11)


    However, I noticed that with my 2.6.29.1-server-4mnb kernel, changing the governor among ondemand, powersave and performance doesn't change the total idle power consumption of my PC measured from the wall outlet. The figure (48W) never changes no matter whether the P-state of the E1400 is at 2GHz or 1.2 GHz. I guess it's probably because the CPU is put into C1E state during idle regardless of the P-state.

    I further noticed from this Japanese website (translated by Google), that the power consumption of the E1400 may be reduced by 4W if its core VID is dropped from 1.30V to 1.05V.

    I recompiled the acpi-cpufreq kernel module after applying the phc-intel patch (urpmi kernel-devel is needed for modpost) then inserted the module phc-intel. Afterwards, I tried to use the phctool to manually set the core VID for the E1400 but the core VID measured by sensors stays constant at 1.20V no matter what's shown in /sys/devices/system/cpu/cpu?/cpufreq/phc_controls.
References:
  1. LessWatts.org
  2. How to use CPU frequency scaling (cpufreq)
  3. Speedstep on Pentium III
  4. Documentation: The /proc/acpi/processor Subdirectory
  5. CPU C-States

No comments: