Re: [PATCH] In-kernel automatic fan control

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] In-kernel automatic fan control

Yury Polyanskiy
Paul,

On Wed, 2005-11-30 at 15:18 +0000, Paul RIVIER wrote:

> I think that speed control is a smarter way to manage the fan.
> It is probably better for it's life time and reduce thermal
oscillation
> in components.

Yeah that also bothered me at first since I read somewhere in I-net
rumors about killing your CPU/GPU with that.

I'm not a specialist in semiconductor technologies so I asked one
(active) professor in that area. His opinion:

1) thermal conditions affect reliability of a chip. His estimate was
that above 90 C every ten degrees double the probability of fault in
some element (non-permanent fault).

2) Thermal cycles indeed negatively affect the lifetime of a chip.
However, there are several things to note:  a) the temperatures that
worse considering are above 80-90 C again, b) the analysis is usually
done for high-performance 24x7 servers => thermal cycles are present all
the time (not just during 1 hour a day when you play Quake), c) the
lifetime reduction is on the order of 10%.

Overall, in any case thermal cycles 45-80 C occuring randomly can't
lower laptop semiconductors' lifetime below 5-7 years. And after that we
don't care anyway.

I don't know how about you but for me that was pretty convincing to not
listen to fan noise for next 5 years ;-).

> But for properly configured laptop, there is not need to trigger at
its
> maximum speed if not under heavy load.
> By and large, my point of view is :
> 1) lower values of the hysterisis values (max 50, min 44 for exemple)
> 2) over 50 : fan with speed control
> 3) if in any case even at low speed, the fan can lower temps under 44°
C,
> stop it.

If you agree that we can put thermal cycles aside then let's assume
using hysterisis at high temps (I use 55 75). So there is indeed no need
to trigger fan at all (my fan last got turned on a week ago when I was
compiling monotone).

But even if you experience high load all the time after temperature got
above 75 C it'll take years for fan to cool it down in low speed mode.
However, it's a matter of taste. I'll try to code something reasonable
so that everyone interested could try what is better for him (5 minutes
of low speed or 1 minute of high speed).

BTW, does anyone have any observations regarding CPU load/fan speed?
Like what level (1-7) can cool what CPU load at what frequency? That
would help constructing somewhat more optimal control algorithm.

Yury.
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: [PATCH] In-kernel automatic fan control

graziano-4
Hello,

just for completeness: I cannot find the extra 3 sensors on my T41
(2378). On my mchine (which is plagued by the almost always on behaviour
of the fan) the GPU seems to be worst offender.

graziano

On Wed, 2005-11-30 at 21:25 +0200, Shem Multinymous wrote:

> Hi,
>
> A few comments about Yury's patch and the ensuing discussion:
>
> Looking only at the maximum temperature is dangerous. Each sensor
> monitors a different component, and each component has a different
> spec and different cooling system. For example, the CPU is rated to 97
> degrees Celsius, the 2200BG mini-PCI card is rated at 80 degrees and
> the battery will die out quite quickly at 50 degrees. The embedded
> controller uses different thresholds for each sensor, for a good
> reason.
>
> Yury's patch only monitors the 8 temperature sensors recognized by
> ibm-acpi (embedded controller offsets 0x78-0x7F). There are at least 3
> more sensors, at EC offsets 0xC0 to 0xC3 (and 0xC4-0xC7 look like
> they're reserved for more sensors). It has been observed by several
> people that the BIOS often steps up the fan speed because of these
> extra sensors. You mustn't ignored them, and you mustn't apply the
> too-generous CPU thresholds to them either. See this discussion:
>
> http://www.thinkwiki.org/wiki/Talk:Problem_with_fan_noise#Secret_sensor_and_the_cause_of_fan_always_on 
>
> As Paul said, it's much better to keep a stable low fan speed than to
> have bursts of high speed - due to fan wear, thermal expansion and
> (subjectively) annoyance effect.
>
> Several people here referred to the 2nd and 3rd sensors (0x79 and
> 0x7A) as "MiniPCI" and "HDD respectively". This is NOT generally true.
> On the T43, sensor 0x79 seems to be in the HDAPS accelerometer chip
> (which sits between the Mini-PCI and the well-ventilated PCMCIA slots,
> so it doesn't reflect Mini-PCI temperature well), and sensor 0x7A
> gives values that are completely uncorrelated with the HDD temperature
> reported by the HDD's SMART interface. For the best available guess
> about the location of the sensors and the appropriate temperatures,
> see the top of the script mentioned earlier:
>
> http://www.thinkwiki.org/wiki/ACPI_fan_control_script#Variable_speed_control_scripts 
>
> Anyway, fan control can be done in kernel despite this complication -
> the core algorithm used by the above script, stripped of comments and
> support code, is just a dozen lines of code. Performance-wise, a
> kernelspace governer is unnecessary (it wakes up only every few
> seconds anyway, just like the embedded controller). Yes, it could
> prevent things like ungraceful death by OOM (graceful death is fine -
> the above script restore the default fan behavior when it's killed).
> But if you care only about ungraceful death then it suffices to have a
> tiny kernel patch that kicks the fan to default speed if it didn't get
> a keep-alive signal (say, a write to /etc/acpi/ibm/fan) for N seconds.
>
> For userspace control of fan speed, there's this patch:
>   http://www.thinkwiki.org/wiki/Patch_for_controlling_fan_speed
> At the bottom of that page you can find the relevant hardware specs
> (including a surprise). But if you don't care about a bit of ugliness,
> you don't even need this patch - just force a certain speed this way:
>
> echo 0x2F 0x00 > /proc/acpi/ibm/ecdump   # fan off
> echo 0x2F 0x01 > /proc/acpi/ibm/ecdump   # fan at low speed
> echo 0x2F 0x04 > /proc/acpi/ibm/ecdump   # fan at medium speed
> echo 0x2F 0x07 > /proc/acpi/ibm/ecdump   # fan at high speed
> echo 0x2F 0x80 > /proc/acpi/ibm/ecdump   # back to automatic speed
>
> Have fun and don't fry your laptop! If it works for you, please report
> your ThinkPad model on the Wiki.
>
>   Shem
>
> P.S. there's also a ThinkPad fan control tool for Windows based on the
> above specs:
>   http://forum.thinkpads.com/viewtopic.php?t=17715
>   http://forum.thinkpads.com/viewtopic.php?t=17733
>
--
+-----------------------+--------------------------+
| Graziano Obertelli    | CS Dept. Rm 102          |
| [hidden email]  | University of California |
| (805) 893-5212        | Santa Barbara, CA 93106  |
+-----------------------+--------------------------+
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] In-kernel automatic fan control

honey-2
In reply to this post by Yury Polyanskiy
On Wed, 30 Nov 2005, Yury Polyanskiy wrote:

> On Wed, 2005-11-30 at 18:10 +0000, honey wrote:
>
>> I'd like to see the "full-speed" patch to ibm-acpi implemented in
>> any script or in-kernel management scheme I use - I couldn't live
>> without it.  A patch was posted to this list to provide this, and I
>> find it invaluable as a short blast of cold air in extreme temperature
>> situations.
>>
>> echo -n full-speed > /proc/acpi/ibm/fan
>>
>> Unsure if it's implemented in any of the above patches or schemes, but I
>> certainly implemented it in Paul's original script, and it works wonders
>> for me.
>
> Sorry what script are you talking about?
>
> Yury.

H Yury,

When I mentioned scripts above, I was just referring the one of the many
fan speed management scripts on the wiki.  The "full-speed" option was
implemented in a patch to ibm_acpi sent to this list some months ago -
searching for "full-speed" or similar in the list archives should find
it.  It pushes fan speed near 5000 rpm on my T40, and is invaluable for
a few seconds burst of cold air when things get really hot.

Having patched ibm_acpi with the patch sent to this list, I then edited
one of the scripts above for three temperature points: LOW, HIGH and
BOILING (with hysteris for each).  It would be really nice if this was
implemented in some of the better scripts available, including ones that
take more than CPU temp into account.

Maybe it's already incorporated in version 12a mentioned by others
here - you'll know if the above command works.  If not, I'd ask again
if Borislav would like to incorporate it in ibm_acpi official?

Honey
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] In-kernel automatic fan control

Yury Polyanskiy
Honey,

'full-speed' is the same as "level disengaged" of fan-speed patch.

Yury.


On Thu, 2005-12-01 at 02:26 +0000, honey wrote:

> H Yury,
>
> When I mentioned scripts above, I was just referring the one of the many
> fan speed management scripts on the wiki.  The "full-speed" option was
> implemented in a patch to ibm_acpi sent to this list some months ago -
> searching for "full-speed" or similar in the list archives should find
> it.  It pushes fan speed near 5000 rpm on my T40, and is invaluable for
> a few seconds burst of cold air when things get really hot.
>
> Having patched ibm_acpi with the patch sent to this list, I then edited
> one of the scripts above for three temperature points: LOW, HIGH and
> BOILING (with hysteris for each).  It would be really nice if this was
> implemented in some of the better scripts available, including ones that
> take more than CPU temp into account.
>
> Maybe it's already incorporated in version 12a mentioned by others
> here - you'll know if the above command works.  If not, I'd ask again
> if Borislav would like to incorporate it in ibm_acpi official?
>
> Honey
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: [PATCH] In-kernel automatic fan control

Yury Polyanskiy
In reply to this post by Yury Polyanskiy
Ok, I agree with most of the points you made. It is indeed should be
more complicated then what was in original patch.

Currently my proposal is:
 1. Use separate thresholds for battery (hardcoded at 40, 45)
 2. Output a huge warning on T43's about non-well understood sensors.
 3. Still use those 0xc0-0xc2 in maximum temp computation.
 4. Some algorithm for 2 step fan speed control (I almost do not hear
the noise difference between level 3 and level 6 so I don't see the
point in using level 3).

Why do I insist on not using separate thresholds for each sensor?

First, because it'll require too much work for maintaining a list of
models, maps of sensors, reasonable thresholds etc.

Second and more important, I don't believe any chip will really be
seriously damaged by temperatures around 60 C. But then how come all
those super-smart IBM/Lenovo engineers put thresholds so much below?

Here is the explanation I think.

In this thread where people discussed fan noise issue with Andy Fisher
(who is HP engineer):
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=853249

One important Andy's response to users concerned about too conservative
thresholds: "The real concern is skin temperature. We don't want the
keyboard feeling hot."

I think the same is true for IBM. 0xC1 sensor some suggest is located
near the touchpad and EC is quite concerned about keeping this value
low. Pretty much correlated with Andy's comment?


Yury.


On Wed, 2005-11-30 at 21:25 +0200, Shem Multinymous wrote:

> Hi,
>
> A few comments about Yury's patch and the ensuing discussion:
>
> Looking only at the maximum temperature is dangerous. Each sensor
> monitors a different component, and each component has a different
> spec and different cooling system. For example, the CPU is rated to 97
> degrees Celsius, the 2200BG mini-PCI card is rated at 80 degrees and
> the battery will die out quite quickly at 50 degrees. The embedded
> controller uses different thresholds for each sensor, for a good
> reason.

> Yury's patch only monitors the 8 temperature sensors recognized by
> ibm-acpi (embedded controller offsets 0x78-0x7F). There are at least 3
> more sensors, at EC offsets 0xC0 to 0xC3 (and 0xC4-0xC7 look like
> they're reserved for more sensors). It has been observed by several
> people that the BIOS often steps up the fan speed because of these
> extra sensors. You mustn't ignored them, and you mustn't apply the
> too-generous CPU thresholds to them either. See this discussion:
>
> http://www.thinkwiki.org/wiki/Talk:Problem_with_fan_noise#Secret_sensor_and_the_cause_of_fan_always_on 
>
> As Paul said, it's much better to keep a stable low fan speed than to
> have bursts of high speed - due to fan wear, thermal expansion and
> (subjectively) annoyance effect.
>
> Several people here referred to the 2nd and 3rd sensors (0x79 and
> 0x7A) as "MiniPCI" and "HDD respectively". This is NOT generally true.
> On the T43, sensor 0x79 seems to be in the HDAPS accelerometer chip
> (which sits between the Mini-PCI and the well-ventilated PCMCIA slots,
> so it doesn't reflect Mini-PCI temperature well), and sensor 0x7A
> gives values that are completely uncorrelated with the HDD temperature
> reported by the HDD's SMART interface. For the best available guess
> about the location of the sensors and the appropriate temperatures,
> see the top of the script mentioned earlier:
>
> http://www.thinkwiki.org/wiki/ACPI_fan_control_script#Variable_speed_control_scripts 
>
> Anyway, fan control can be done in kernel despite this complication -
> the core algorithm used by the above script, stripped of comments and
> support code, is just a dozen lines of code. Performance-wise, a
> kernelspace governer is unnecessary (it wakes up only every few
> seconds anyway, just like the embedded controller). Yes, it could
> prevent things like ungraceful death by OOM (graceful death is fine -
> the above script restore the default fan behavior when it's killed).
> But if you care only about ungraceful death then it suffices to have a
> tiny kernel patch that kicks the fan to default speed if it didn't get
> a keep-alive signal (say, a write to /etc/acpi/ibm/fan) for N seconds.
>
> For userspace control of fan speed, there's this patch:
>   http://www.thinkwiki.org/wiki/Patch_for_controlling_fan_speed
> At the bottom of that page you can find the relevant hardware specs
> (including a surprise). But if you don't care about a bit of ugliness,
> you don't even need this patch - just force a certain speed this way:
>
> echo 0x2F 0x00 > /proc/acpi/ibm/ecdump   # fan off
> echo 0x2F 0x01 > /proc/acpi/ibm/ecdump   # fan at low speed
> echo 0x2F 0x04 > /proc/acpi/ibm/ecdump   # fan at medium speed
> echo 0x2F 0x07 > /proc/acpi/ibm/ecdump   # fan at high speed
> echo 0x2F 0x80 > /proc/acpi/ibm/ecdump   # back to automatic speed
>
> Have fun and don't fry your laptop! If it works for you, please report
> your ThinkPad model on the Wiki.
>
>   Shem
>
> P.S. there's also a ThinkPad fan control tool for Windows based on the
> above specs:
>   http://forum.thinkpads.com/viewtopic.php?t=17715
>   http://forum.thinkpads.com/viewtopic.php?t=17733
>
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] In-kernel automatic fan control

honey-2
In reply to this post by honey-2
> On Wed, 30 Nov 2005, Yury Polyanskiy wrote:
>
>> Sorry what script are you talking about?
>>
>> Yury.
>
> H Yury,
>
> When I mentioned scripts above, I was just referring the one of the many
> fan speed management scripts on the wiki.  The "full-speed" option was
> implemented in a patch to ibm_acpi sent to this list some months ago -
> searching for "full-speed" or similar in the list archives should find
> it.  It pushes fan speed near 5000 rpm on my T40, and is invaluable for
> a few seconds burst of cold air when things get really hot.
>
> Having patched ibm_acpi with the patch sent to this list, I then edited
> one of the scripts above for three temperature points: LOW, HIGH and
> BOILING (with hysteris for each).  It would be really nice if this was
> implemented in some of the better scripts available, including ones that
> take more than CPU temp into account.
>
> Maybe it's already incorporated in version 12a mentioned by others
> here - you'll know if the above command works.  If not, I'd ask again
> if Borislav would like to incorporate it in ibm_acpi official?
>
> Honey

I've now found the post I was referring to with the full-speed patch to
ibm_acpi:

http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2005-August/028807.html

by Thomas Renninger.  Maybe this is already included in the ibm_acpi
version 12a release talked about here?  Could someone confirm?  If not,
it really should be.

Honey
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: [PATCH] In-kernel automatic fan control

honey-2
In reply to this post by Yury Polyanskiy
I keep posting.  Sorry.  Having read up that ibm_acpi 12a is
included in 2.6.14 (I'm not there yet), I wanted to point out that
the "full-speed" patch I mentioned in the last post sets the fan on
a significantly higher speed than the documented "maximum" speed of
mode 7, testing on my T40:

On Wed, 30 Nov 2005, Shem Multinymous wrote:

> echo 0x2F 0x00 > /proc/acpi/ibm/ecdump   # fan off
> echo 0x2F 0x01 > /proc/acpi/ibm/ecdump   # fan at low speed
> echo 0x2F 0x04 > /proc/acpi/ibm/ecdump   # fan at medium speed
> echo 0x2F 0x07 > /proc/acpi/ibm/ecdump   # fan at high speed
> echo 0x2F 0x80 > /proc/acpi/ibm/ecdump   # back to automatic speed

echo 0x2F 0x07 > /proc/acpi/ibm/ecdump
- 4000 rpm
echo -n full-speed > /proc/acpi/ibm/fan
- 5500 rpm

The latter is very useful.  I wonder if someone could clarify where
these two patches stand, as I'd like "full-speed" to be available in
a consolidated ibm_acpi patch.  Especially useful for machines that,
as was mentioned yesterday, seem to have somewhat erratic temperature
probes and can overheat in extreme circumstances, which seems still
reasonable common on this list.

Honey
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] In-kernel automatic fan control

honey-2
In reply to this post by Yury Polyanskiy
On Wed, 30 Nov 2005, Yury Polyanskiy wrote:

> Honey,
>
> 'full-speed' is the same as "level disengaged" of fan-speed patch.
>
> Yury.

Thanks Yruy - confirmed that

echo 0x2F 0x40 >! /proc/acpi/ibm/ecdump

does indeed match full-speed.

Do you incorporate bursts of disengaged fan mode at very high
temperature in your patch?  Using it in my script, I've found literally
a few seconds burst at very high temperature works wonders.

Honey
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] In-kernel automatic fan control

Yury Polyanskiy
Honey,

I think using this is pretty dangerous because this clearly uses fan
beyond its specification. Lifetime of a fan is definitely a concern for
me. People from "speed-control-patch" added level disengaged for
pulse-noise problem workaround I believe.

Yury.

On Thu, 2005-12-01 at 18:48 +0000, honey wrote:

> On Wed, 30 Nov 2005, Yury Polyanskiy wrote:
>
> > Honey,
> >
> > 'full-speed' is the same as "level disengaged" of fan-speed patch.
> >
> > Yury.
>
> Thanks Yruy - confirmed that
>
> echo 0x2F 0x40 >! /proc/acpi/ibm/ecdump
>
> does indeed match full-speed.
>
> Do you incorporate bursts of disengaged fan mode at very high
> temperature in your patch?  Using it in my script, I've found literally
> a few seconds burst at very high temperature works wonders.
>
> Honey
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] In-kernel automatic fan control

honey-2
On Thu, 1 Dec 2005, Yury Polyanskiy wrote:

> Honey,
>
> I think using this is pretty dangerous because this clearly uses fan
> beyond its specification. Lifetime of a fan is definitely a concern for
> me. People from "speed-control-patch" added level disengaged for
> pulse-noise problem workaround I believe.
>
> Yury.

Hmm really?  Is the fan spec available online somewhere?  Clearly I
don't want to break it, but it's so useful.  It's a wonder disengaged
mode is at all available if beyond spec.
--
The linux-thinkpad mailing list home page is at:
http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
Loading...