Re: Broken APIC on my laptop or bug in FreeBSD?

From: Alexandre \ <gaijin.k_at_gmail.com>
Date: Sat, 19 Jul 2008 20:36:22 -0400
On Sun, 2008-07-20 at 02:57 +0300, Giorgos Keramidas wrote:
> On Sat, 19 Jul 2008 18:57:10 -0400, "Alexandre \"Sunny\" Kovalenko" <gaijin.k_at_gmail.com> wrote:
> > On Sun, 2008-07-20 at 01:51 +0300, Giorgos Keramidas wrote:
> >> That was it.  Thanks!
> >>
> >>   # sysctl -a | egrep -e 'cx_(usage|support)'
> >>   dev.cpu.0.cx_supported: C1/1 C2/1 C3/57
> >>   dev.cpu.0.cx_usage: 100.00% 0.00% 0.00%
> >>   dev.cpu.1.cx_supported: C1/1 C2/1 C3/57
> >>   dev.cpu.1.cx_usage: 100.00% 0.00% 0.00%
> >>
> >> With anything except "C1" the CPU is obviously too slow to do
> >> anything useful :-)
> >
> > I guess it got worse in CURRENT:
> >
> > # uname -a
> > FreeBSD RabbitsDen.RabbitsLawn.verizon.net 7.0-STABLE FreeBSD 7.0-STABLE
> > #0: Wed Jul  9 16:52:35 EDT 2008
> > root_at_RabbitsDen.RabbitsLawn.verizon.net:/usr/obj/usr/src/sys/TPX60  i386
> > RabbitsDen# sysctl -a | egrep -e 'cx_(usage|support)'
> > dev.cpu.0.cx_supported: C1/1 C2/1 C3/57
> > dev.cpu.0.cx_usage: 0.00% 100.00% 0.00%
> > dev.cpu.1.cx_supported: C1/1 C2/1 C3/57
> > dev.cpu.1.cx_usage: 0.00% 4.43% 95.56%
> 
> Now that I know what to look for, I see that what is reported in
> cx_supported is an array from the `struct acpi_cpu_softc' for each cpu.
> The initialization of per-cpu dev.cpu.*.cx_xxx values in the softc of
> the cpu is done in sys/dev/acpica/acpi_cpu.c:acpi_cpu_cx_cst().
> 
> I am probably not qualified to say if 'things got worse' in CURRENT, but
> I wish there was a way to find out *before* entering a state where the
> CPU is too slow to do basic tasks (i.e. time keeping, and scheduling
> processes).
> 
What I meant is that my laptop, runnig RELENG_7 is pretty happy with
"C2" (set through /etc/rc.conf as performance_cx_lowest="C2", and even
"C3" (set through /etc/sysctl.conf as dev.cpu.1.cx_lowest=C3), so long
as cpu0 is not allowed to go into C3. You seemed to indicate that in
your case nothing but "C1" worked. If you just did not try the
configuration above, would you, please, try it and see if it works.
Apart from, hopefully, giving someone the data point, it will make your
laptop cooler and less power hungry.

Now, as far as finding out how bad coming out of the state is, that's
what the numbers after the slash in "supported" are for. Coming out of
C3 on my CPU (and yours) will take 57 times longer than coming out of
C2. You can play games with your ASL to change that value. I am sure
that I am not qualified to say whether it gets honored, though.

Few more data points:
-- CPU0 and CPU1 are somehow not treated interchangeably by FreeBSD.
-- at some point when earth was warm and 7.0 was CURRENT, "C3" used to
work on my laptop, even on CPU0.
-- I have not filed a PR. If you think it is warranted, you could do it
or I can -- it's just I did a couple of embarrassing ones and got
somewhat trigger-shy ;)

-- 
Alexandre "Sunny" Kovalenko (Олександр Коваленко)
Received on Sat Jul 19 2008 - 22:36:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:33 UTC