Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 May 2004 08:50:33 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Mike Silbersack <silby@silby.com>
Cc:        acpi@freebsd.org
Subject:   Re: power savings and usb
Message-ID:  <20040506084132.L41848@root.org>
In-Reply-To: <20040506035840.G811@odysseus.silby.com>
References:  <200405052004.i45K4EnF029671@repoman.freebsd.org> <20040505171634.N37631@root.org> <20040506025051.V630@odysseus.silby.com> <20040506034307.M811@odysseus.silby.com> <20040506035840.G811@odysseus.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[moved to acpi@]

On Thu, 6 May 2004, Mike Silbersack wrote:
> On Thu, 6 May 2004, Mike Silbersack wrote:
>
> > Good deal, it works as avertised.  I even learned a bit of shell scripting
> > in the process of writing a simple speed switching script. :)
> >
> > Of course, the real question is whether or not it'll actually help battery
> > life at all; this is a mobile celeron, I suspect that I won't have much of
> > an impact.  Ah well.

Using the C3 idle state makes my laptop noticeably cooler and the fan
doesn't come on in normal usage.

> Gah, except that my experiment in clockswitching made the usb stack mad,
> so it's constantly priniting "usb0: X scheduling overruns", where X
> appears to be a number containing one or two bits of entropy per second.
> I will have to go visit ohci.c with a cluebat when I get a chance.
>
> Er, it stopped when I plugged in the power cord, and starts again when I
> unplugged it.  Is it possible that ohci.c is reading some USB voltage
> value instead of the overrun bit that it thinks it is reading?

Nope, we auto-switch cpu idle values (and optionally throttle states) on
AC line transition.  See /etc/rc.d/power_profile and the options in
/etc/defaults/rc.conf:

performance_cx_lowest="HIGH"            # Online CPU idle state
performance_throttle_state="HIGH"       # Online throttling state
economy_cx_lowest="LOW"                 # Offline CPU idle state
economy_throttle_state="HIGH"           # Offline throttling state

The default online is to use C1 (or HLT as it's known elsewhere).  This is
existing behavior.  The default offline is to switch to the lowest state
available.  On my laptop, this is C3.  (The default for throttling is to
leave it off since it is more disruptive).  The problem with C3 is that if
you have USB loaded, it is rarely used for idling as USB constantly uses
bus mastering in polling for new devices.  This is ok since we demote to
C2 in this case.  You can observe this via sysctl hw.acpi.cpu:

hw.acpi.cpu.cx_supported: C1/0 C2/84 C3/120
hw.acpi.cpu.cx_lowest: 1
hw.acpi.cpu.cx_history: 9175/0 173443/9175 0/0

This means I am requesting a lowest sleep of C2 (idx 1 of the options
supported).  The history values show that I haven't used C3 at all and am
using C2 at a rate of about 95%.

ohci may have problems with C3.  On my uhci, it demotes to C2 without
causing problems.  You can override this by setting in /etc/rc.conf:

economy_cx_lowest="1"

-Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040506084132.L41848>