Management of Thermal

Norberto Meijome freebsd at meijome.net
Wed Oct 10 16:23:52 PDT 2007


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

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.

> 
> 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?

> 
>  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..

> 
> More about that and powerd below ..
> 
>  > > I'm asking before i've been getting very high temperature (99 degrees, which
>  > > matches my CRIT value ,on a Thinkpad z60m, Pentium M 2 GHz), when building
>  > > ports / world.
>  > > 
>  > > 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...)

> 
>  > > 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) .
> 
> My fan seems to come on at around 75C, no idea where that's set.

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.


> 
>  > > Annoyingly, it will drop down to 100 Mhz  - I suppose it is
>  > > cpufreq kicking in trying to control the temperature, but it's completely
>  > > unusable. (yes, i've forced it to not less than 932 Mhz, but it still warms up
>  > > too much).
>  > > 
>  > > 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

> 
> I've not played with thermal settings at all, so can't comment.
> 
>  > > ### trying to finetune the action of the thermal zones
>  > > ## man 4 acpi_thermal
>  > > ## for details
>  > > ## Defaults:
>  > > #hw.acpi.thermal.min_runtime: 0
>  > > #hw.acpi.thermal.polling_rate: 10
>  > > #hw.acpi.thermal.user_override: 0
>  > > #hw.acpi.thermal.tz0.temperature: 91.0C
>  > > #hw.acpi.thermal.tz0.active: -1
>  > > #hw.acpi.thermal.tz0.passive_cooling: 0
> 
> Mine's always 1, man says default on - is this your current setting?

that's the default from the man pages. Every time I check mine, it's on 1 too.

> 
>  > > #hw.acpi.thermal.tz0.thermal_flags: 0
>  > > #hw.acpi.thermal.tz0._PSV: 94.5C
>  > > #hw.acpi.thermal.tz0._HOT: -1
>  > > #hw.acpi.thermal.tz0._CRT: 99.0C
>  > > #hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
>  > > ## 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

> but I'm well out of my depth here .. 

jon the club :)

> 
>  > > Any help / pointers would be greatly appreciated...
> 
> The info on tzs and fan settings from acpi_ibm might have clues?
> 
>  > Some more info :
>  > 
>  > $ kldstat
>  > Id Refs Address    Size     Name
>  >  1   34 0xc0400000 4c3d24   kernel
>  >  2    1 0xc08c4000 836c     linprocfs.ko
>  >  3    3 0xc08cd000 21ebc    linux.ko
>  >  4    1 0xc08ef000 135e0    snd_hda.ko
>  >  5    2 0xc0903000 68e48    sound.ko
>  >  6    2 0xc096c000 17920    agp.ko
>  >  7    2 0xc0984000 666a8    acpi.ko
>  >  8    1 0xc09eb000 4c4c     acpi_ibm.ko
>  >  9    1 0xc09f0000 b668     cpufreq.ko
>  > 10    1 0xc09fc000 1d498    kqemu.ko
>  > 11    1 0xc0a1a000 22140    radeon.ko
>  > 12    2 0xc0a3d000 10c68    drm.ko
>  > 13    1 0xc5d86000 c000     ipfw.ko
>  > 14    1 0xc5e93000 7000     aio.ko
>  > 15    1 0xc9fbd000 2000     rtc.ko
>  > 
>  > 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"
## 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

#loader.conf.local

acpi_load="YES"
acpi_ibm_load="YES"
cpufreq_load="YES"


 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 :) )

> 
> 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.
> 
> Another thing with powerd - have you tried running it with -v in fg? 
> With my 2-speed the shift points seem about right, but with lots of
> speeds I'd be curious to try optimising the idle / running shifts in
> terms of hysteresis, 'hunting' up and down with different loads and
> such.  'Someone' could do up some nice graphs :)

i have in the past, not now

> 
> Is yours 6-stable?  There's also some newer stuff about Cx levels for
> SMP systems in -current over in freebsd-acpi.

ok...i may have a look @ this, but right now i need to be able to run non stop
> 
> Cheers, Ian
> 

It seems I'll have to sit down and do some more organised testing.... 

thx everyone! :)

_________________________
{Beto|Norberto|Numard} Meijome

unzip ; strip ; touch ; grep ; find ; finger ; mount ; fsck ; more ; yes ;
fsck ; umount ; sleep

I speak for myself, not my employer. Contents may be hot. Slippery when wet.
Reading disclaimers makes you go blind. Writing them is worse. You have been
Warned.


More information about the freebsd-mobile mailing list