Laptop ACPI question
Kevin Oberman
oberman at es.net
Sat May 1 14:05:37 PDT 2004
> From: "Markie" <mark.cullen at dsl.pipex.com>
> Date: Sat, 1 May 2004 21:29:56 +0100
> Sender: owner-freebsd-mobile at freebsd.org
>
> Hello,
>
> Just a quick question... would having ACPI working on a laptop increase
> battery life at all? I just left it sat idle without ACPI and it got to an
> hour and 30 minutes... I went to start xchat and it just switched off
> straight away after it started loading :o) if I leave it doing `cat
> /dev/random > /dev/null` it only lasts 45 minutes :o(
>
> I am just wondering if it's a naffed battery... or... there's something a
> bit wrong with the laptop or... I just need ACPI? I don't really know what
> ACPI does, so.... :o)
Actually, ACPI will greatly improve battery life soon, but not yet. The
bits and pieces are being fed into CURRENT and I suspect that SpeedStep
support will be coming soon.
In the meantime, you can use sysctls to manually adjust CPU performance
to enhance battery life.
Look at:
hw.acpi.cpu.throttle_max: 8
hw.acpi.cpu.throttle_state: 8
hw.acpi.cpu.cx_supported: C1/0 C2/1 C3/85
hw.acpi.cpu.cx_lowest: 0
hw.acpi.cpu.cx_history: 1453705/0 0/0 0/0
Reducing the hw.acpi.cpu.throttle_state will increase battery life by
effectively reducing CPU speed. The reduction is linear and a setting of
1 makes my system crawl.
Setting hw.acpi.cpu.cx_lowest will reduce the responsiveness of P4-M or
Centrino system by putting the system in a "deeper sleep" than just
halting the CPU. The cost is that it takes longer for the system to
start processing again. Its effect can appear as jerkiness in some
operations. It may be set to as many values (higher is slower) as are
listed in cx_history. (In the example, there are three, 0, 1, and 2
available.) Depending on hardware connected, some levels may not be
available. On my laptop, 2 is not available if the USB driver is loaded.
The history also shows how often each sleep mode has been invoked.
When the acpi_cpufreq code is ready, it will provide the best power control,
but this can help.
I'll append a little snippet I use to adjust the power, but feel free to
try other combinations.
--
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman at es.net Phone: +1 510 486-8634
#!/bin/sh
case "$1" in
ac)
sudo sysctl hw.acpi.cpu.throttle_state=8
sudo sysctl hw.acpi.cpu.cx_lowest=0
echo "Set to AC power (high) performance"
;;
hi)
sudo sysctl hw.acpi.cpu.throttle_state=8
sudo sysctl hw.acpi.cpu.cx_lowest=2
echo "Set to high battery performance"
;;
normal)
sudo sysctl hw.acpi.cpu.throttle_state=4
sudo sysctl hw.acpi.cpu.cx_lowest=2
echo "Set to normal battery performance"
;;
lo)
sudo sysctl hw.acpi.cpu.throttle_state=1
sudo sysctl hw.acpi.cpu.cx_lowest=2
echo "Set to low battery performance"
;;
*)
echo "Usage: `basename $0` (ac|hi|normal|lo)" >&2
exit 64
;;
esac
exit 0
More information about the freebsd-mobile
mailing list