Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2010 16:46:40 -0700
From:      John Long <fbsd2@sstec.com>
To:        Alexander Motin <mav@FreeBSD.org>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@FreeBSD.org>
Subject:   Re: Powerd and est / eist functionality
Message-ID:  <5.2.1.1.2.20100326161613.0316fc28@mail.sstec.com>
In-Reply-To: <4BAC70EB.5020606@FreeBSD.org>
References:  <5.2.1.1.2.20100325235505.031e8338@mail.sstec.com> <5.2.1.1.2.20100324134153.032459d8@mail.sstec.com> <1269310984.00232724.1269300005@10.7.7.3> <1269310984.00232724.1269300005@10.7.7.3> <5.2.1.1.2.20100324134153.032459d8@mail.sstec.com> <5.2.1.1.2.20100325235505.031e8338@mail.sstec.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 01:31 AM 3/26/2010, Alexander Motin wrote:
 >John Long wrote:
 >>>Have you tried C2?  Are you running the latest BIOS?  And perhaps your
 >>>ACPI ASL may be amenable to repair, if Gigabyte ACPI is broken here?
 >
 >As I can see, your ACPI reports C3 state support. You may try it also.
 >Here is my notes about power and C3 also:
 >http://wiki.freebsd.org/TuningPowerConsumption
 >Alexander Motin

Hi, you have achieved good results with your laptop tuning, 50% power 
reduction.

I tried the disable thing and got what I thought would happen.
hint.p4tcc.0.disabled=1
hint.acpi_throttle.0.disabled=1

Since est is not working on this system then it falls back to p4tcc and 
throttle but if they are disabled then powerd chokes with "lookup freq: no 
such file or directory" and does not run.

I did locate est.c under cpufreq dir. It looks to be from 2004/5 era and 
alas the cpu lookups in there are most all from that time frame also. I 
find this bit of code:
/*
  * Probe for supported CPU settings.  First, check our static table of
  * settings.  If no match, try using the ones offered by acpi_perf
  * (i.e., _PSS).  We use ACPI second because some systems (IBM R/T40
  * series) export both legacy SMM IO-based access and direct MSR access
  * but the direct access specifies invalid values for _PSS.
  */
static int
est_get_info(device_t dev)
{
         struct est_softc *sc;
         uint64_t msr;
         int error;

         sc = device_get_softc(dev);
         msr = rdmsr(MSR_PERF_STATUS);
         error = est_table_info(dev, msr, &sc->freq_list);
         if (error)
                 error = est_acpi_info(dev, &sc->freq_list);
         if (error)
                 error = est_msr_info(dev, msr, &sc->freq_list);

         if (error) {
                 printf(
         "est: CPU supports Enhanced Speedstep, but is not recognized.\n"
         "est: cpu_vendor %s, msr %0jx\n", cpu_vendor, msr);
                 return (ENXIO);
         }

         return (0);
}

Therein looks to be the problem, the msr table/freq_list lookup is just way 
out of date and fails to load est and therefore the fallback to p4tcc for 
powerd which is useless for reduction. I need to get est running so that it 
handles the P-states which include the voltage reduction. There are a 
couple other places where it tests and sets flags that may be relevant but 
it is a little bit more work and a little over my head than I was looking 
for. Maybe ACPI is just not giving enough info and the asl can be modified 
but I do not know enough about it or much of any of this.. There is a whole 
box of worms in acpica dir. I looked thru acpi_perf.c but the rabbit trail 
looks a bit daunting. There are briar patches throughout.

Maybe Colin Percival or Nate Lawson can shed some light on this and if it 
is reasonable to do an update for that bit of code/table. If there were a 
prog that could invoke est.c and have it spit out the factors it sees for a 
clue as to just what might be needed to get it loaded, that would be helpful.
 >>    est: CPU supports Enhanced Speedstep, but is not recognized.
 >>    est: cpu_vendor GenuineIntel, msr 6160b2506000b25
is meaningless to me :-(

I do realize that there have been hundreds of cpus and factors since that 
time, maybe a wildcard lookup of some sort would suffice. To just get this 
thing loaded because the rest of the code looks clever and good. Also, if 
some discovery here helps the project and saves a few watts times thousands 
of us then it might be worth pursuing but if the general consensus is not 
worth the trouble then I understand.

John

btw: I had tried C3 earlier and C2 also, they both save about 1 watt max 
and C3 is quite a dramatic thing to do considering the crucial parts of the 
system it shuts down. For a laptop that would be okay but this is going to 
be a relatively busy server running dns, apache, nat etc. I do not think it 
will have much time to sleep but with the speed of a c2d it will not been 
too busy either, always just a few percent. Therein lies my desire, to get 
the voltage down when the freq is low and still allow demand speed to be 
there if needed.




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