Management of Thermal

Ian Smith smithi at nimnet.asn.au
Sat Oct 13 21:54:33 PDT 2007


Hi Beto .. excuse the delay, small matter of a tennis-ball sized hail
storm partly trashing my daughter's house and son's car in Lismore .. 

On Thu, 11 Oct 2007, Norberto Meijome wrote:
 > On Tue, 9 Oct 2007 03:21:20 +1000 (EST)
 > Ian Smith <smithi at nimnet.asn.au> wrote:
 > 
 > > On Mon, 8 Oct 2007, Norberto Meijome wrote:
 > >  > On Mon, 8 Oct 2007 17:27:56 +1000
 > >  > Norberto Meijome <freebsd at meijome.net> wrote:
 > >  > 
 > >  > > Hello everyone,
 > >  > > is there any documentation / resource on how to configure properly the
 > >  > > different methods for management of power/thermal related components/services?
 > >  > > 
 > >  > > eg,
 > >  > > acpi (acpi_thermal), and all the knobs via sysctl
 > >  > > powerd
 > >  > > cpufreq
 > > 
 > > I've often wished there was :)  There aren't even man pages for some
 > > components, acpi_throttle and acpi_perf being two I've tried following
 > > some of the code for recently.  Most of it well over my head, but there
 > > be clues amongst the dragons.
 > 
 > Hi Ian,
 > thanks for the email....let's see...
 > 
 > First of all, I've been running since last night with Lars' initial suggestion :
 > cpufreq.ko loaded (not Lars' suggestion, but i can't do without this for
 > now....) powerd -a adaptive -b adaptive

'-a adaptive -b adaptive' are the default options anyway.  Or were in
6.1 and in 5.5-STABLE as at March, but I don't think that's changed. 

 > Temperature when idle / normal desktop tasks is definitely lower , plugged to
 > AC, hovering on the 55-65 mark - GOOD!!!
 > 
 > I have just checked the bios and, Power -> Adaptive Thermal Management ->
 > Scheme for AC was on 'maximise performance'. I've switched this to Balanced,
 > which is the same profile as set for 'running on batteries'. Will see how it
 > goes.

I don't know whether (or how) the IBM BIOS settings still apply, or are
entirely overridden, by FreeBSD's ACPI (and acpi_ibm) settings, or not. 
Maybe with the new stuff in 7.0 there's now a man page for acpi_ibm? :)

 > > If you don't solve this, check freebsd-acpi archives since say August
 > > for several too-hot scenarios.  This recent one smells similar, and Lars
 > > also mentioned the Cx levels, it's been coming up a bit:
 > 
 > ta, i'll check it... part of the trick is trying to come up with a reliable
 > test so we can compare the results.... I'm thinking a : cd /usr/src
 > make clean
 > # on another shell
 > run a tight loop recording (every 5 secs? ) cpu temperature, fan speed and
 > system load # start test
 > make buildworld 
 > 
 > see how it goes...
 > 
 > Any other suggestions?

I've been running a simple script showing cpu freq, load, cx_usage,
battery state|life|time, acpi_ibm fan|thermal once a minute for ages,
just to watch and learn, but I've had no overheating problems to prompt
me to dig deeper.

 > >  http://lists.freebsd.org/pipermail/freebsd-acpi/2007-October/004120.html
 > >  
 > >  | Also, see if you're using lower Cx levels for cpu idling.  They can
 > >  |  make a big heat difference.
 > >  |
 > >  | performance_cx_lowest="LOW"
 > >  | economy_cx_lowest="LOW"
 > 
 > gotcha.  OK, so these and the other 2 in /etc/defaults/rc.conf : 
 > 
 > performance_cx_lowest="HIGH"    # Online CPU idle state
 > performance_cpu_freq="NONE"     # Online CPU frequency
 > economy_cx_lowest="HIGH"        # Offline CPU idle state
 > economy_cpu_freq="NONE"         # Offline CPU frequency
 > 
 > seem to be related to /etc/rc.d/power_profile. The power_profile script refers
 > to the 3 values of HIGH, LOW and NONE, though I can't see the knobs listed in
 > the defaults file (they are probably built on real time..

Yes, power_profile dynamicaly parses sysctls hw.acpi.cpu.cx_supported
and dev.cpu.0.freq_levels for the first and last values for HIGH and LOW
respectively and sets them according to the rc.conf values.  NONE just
leaves things alone on switching between AC and battery.  So for
_cx_lowest HIGH will be always be C1, LOW may be C2 or C3, depending. 

 > >  > > I am not sure whether / how to tell it to use EST properly.
 > > 
 > > Might be acpi_perf instead?  Which of these shows up in dmesg?
 > 
 > est does :
 > est0: <Enhanced SpeedStep Frequency Control> on cpu0
 > and this too
 > p4tcc0: <CPU Frequency Thermal Control> on cpu0
 > 
 > no mention of 'perf' anywhere (other than related to GIANT...)

Ok, my T23 uses acpi_perf for its P3-M.  Unless changed in 7.0:
% man est
No manual entry for est
% man p4tcc
No manual entry for p4tcc
% man acpi_perf
No manual entry for acpi_perf
:(

 > >  > > I can't feel the fans working really hard at all (maybe it's the way it's
 > >  > > supposed
 > >  > > to
 > >  > > work? ) dev.acpi_ibm.0.fan_speed does report over 3K RPM ... 
 > > 
 > > My T23 fan runs near 5k, and is still pretty quiet, but that's pumping
 > > quite hot air onto my hand, steady at about 70C running 2000 invocations
 > > of rexxcps - lame I know; fully cpu intensive but hardly a buildworld.
 > > But then its P3-M is only rated at 1133MHz / 19100mW, with only a
 > > 2-speed auto down to 733/12500, so it's not so hard to cool
 > 
 > well, that sounds pretty reasonable. Maybe because mine is the 'centrino'
 > platform, it uses less fans than previous? (no idea if the T23 is
 > centrino...i think it came out earlier.., but i could be wrong) .

Much earlier - mine's dated 02/08: Intel(R) Pentium(R) III Mobile CPU   1133MHz

 > > My fan seems to come on at around 75C, no idea where that's set.

I thought maybe that was a BIOS-controlled thing.  Wish I knew.

 > man acpi_thermal :
 >      hw.acpi.thermal.tz%d._ACx
 >              Temperatures at which to switch to the corresponding active cool-
 >              ing level.  The lower the _ACx value, the higher the cooling
 >              power.
 > 
 > I haven't played with this one yet... trying to understand to which subsystem
 > each thing belongs to.

Yeah it's fairly confusing, with only the code as docs .. but I really
haven't looked at the state of play on -current, so may be pleasantly
surprised.

 > >  > > I played a bit with the knobs for *thermal*, but i am not entirely sure i'm
 > >  > > improving things... in my sysctl i had (before disabling it all)
 > >  > > 
 > >  > > # Lowest CPU frequency in MHz to offer to users
 > >  > > debug.cpufreq.lowest=932
 > > 
 > > Does that work right?  Are you displaying cpu freq in gkrellm or such?
 > 
 > yes and yes (well, playing with other tools now, but effect is the same). but I
 > think it has to drop to 100 (well, lower than 932 at least).... it was heating
 > up too fast otherwise

Alexandre "Sunny" Kovalenko's and Richard Arends' posts this morning our
time have shed quite a bit of light.  My T23's at 6.1-R and
dev.acpi_ibm.0.fan and ..fan_speed are read-only, dunno about 6-STABLE? 

 > >  > > ## Custom values
 > >  > > hw.acpi.thermal.user_override=1
 > >  > > hw.acpi.thermal.min_runtime=10
 > >  > > hw.acpi.thermal.polling_rate=5
 > >  > > hw.acpi.thermal.tz0.active=85C
 > >  > > hw.acpi.thermal.tz0._PSV=90C
 > > 
 > > Just curious re syntax - do these values read back right after setting? 
 > > And if you're overriding, is that the right setting for .tz0.active ? 
 > 
 > No idea on both accounts...  they were an initial test and didn't work too well
 > either. Thinking about it now, yeah, active should probably be lower

And be a level, not a temperature ..

 > > but I'm well out of my depth here .. 
 > 
 > jon the club :)

I guess it's time to update my T23 to 7.0 .. I was hoping to update the
BIOS and EC first - seems I need to either add a USB floppy or install
Windows to do that :( - but I might just go for it anyhow, if time.

 > >  > Powerd is enabled.
 > >  > 
 > >  > I am currently doing not much at all (listening to music stream, load
 > >  > of 0.24, 0.45, 0.69) and tz0 = 78C. it drops down a lot more when
 > >  > running on batteries only
 > > 
 > > Ouch.  Couple of maybes.  powerd fights with power_profile, which will
 > > set both dev.cpu.0.freq and hw.acpi.cpu.cx_lowest on AC/battery
 > > transitions, so you might want these in rc.conf (/etc/rc.d/power_profile
 > > for doc :) 
 > > 
 > >  performance_cpu_freq="NONE"
 > >  economy_cpu_freq="NONE"
 > > 
 > > as well as the abovementioned *cx_lowest="LOW" to see if it helps - said
 > > to with some setups and not others, sorry just recalling passing notes -
 > > and if so you could try say C2 or C3 setting directly. 
 > 
 > Ok, I've been running with 
 > #sysctl.conf
 > hw.acpi.cpu.cx_lowest=C3
 > 
 > since you sent this email, and the following settings:
 > 
 > #rc.conf
 > powerd_enable="YES"
 > powerd_flags="-a adaptive -b adaptive"

powerd assumes these defaults if no flags are specified anyway.  So if
you have improvement, it's likely down to using C3.  Maybe looking at
hw.acpi.cpu.cx_usage now and again will show what level is most used?

 > ## Disable power_profile behaviour...
 > performance_cx_lowest="NONE"    # Online CPU idle state
 > performance_cpu_freq="NONE"     # Online CPU frequency
 > economy_cx_lowest="NONE"        # Offline CPU idle state
 > economy_cpu_freq="NONE"         # Offline CPU frequency

Well you need *_cpu_freq="NONE" but you could specify *_cx_lowest="LOW". 
It's also possible this code has since changed to not require setting
*cpu_freq="NONE" to use powerd, it was 'relatively undocumented' anyway.

 > #loader.conf.local
 > 
 > acpi_load="YES"
 > acpi_ibm_load="YES"
 > cpufreq_load="YES"

cpu/cpufreq is in my (6.1-R) GENERIC kernel anyhoo ..

 >  Temperature hasn't
 > reached critical, or over 96, which is really good, but i'm still
 > dropping to 100 MHz, which isn't very nice during a normal workday (including
 > having a QEMU with XP Pro in it and skype being used on calls,etc...). I had to
 > revert the BIOS back to 'performance' when connected to AC, it seemed too
 > sluggish when telling the BIOS to use the same profile in AC as when on
 > batteries (which is expected :) )

I'm still curious .. I thought the BIOS settings would be more clues for
window$ than hard-wired settings, but I'd love to know more about that.

Richard Arends' perl script looks worth a try .. I assume you'd not
want to run powerd as well, or you'd have a real fight on your hands ..
but can you modify dev.acpi_ibm.0.fan and ..fan.level on 6-STABLE?

 > > Funny thing with my T23 .. if I boot on AC, I can set cx_lowest=C3 but
 > > it only drops back to C2, if hw.acpi.cx_usage is to be believed, but if
 > > I boot on battery and set cx_lowest=C3, all three get used henceforth.

This is something else I'll have to revisit after upgrading (incl BIOS).

Cheers, Ian



More information about the freebsd-mobile mailing list