[ltp] fancontrol script causes hundreds of wakeups per second

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Tue, 1 Jul 2008 20:16:58 -0300


On Tue, 01 Jul 2008, Henrique de Moraes Holschuh wrote:
> On Wed, 02 Jul 2008, Tino Keitel wrote:
> > I tried the fancontrol script from
> > http://www.thinkwiki.org/wiki/How_to_control_fan_speed and noticed that
> > it causes 100-200 wakeups per second in powertop. This happens on a
> > X61s. Can this be avoided somehow?
> 
> No.  Unless you are talking about hacking the EC firmware to change its own
> fan controller parameters.

I better explain it a bit more.

1. Reading the thermal sensors *IS* quite expensive, there are a lot of
them.

2. Setting the fan controller parameters is not the cheapest operation
around, either.

So that means a lot of wakeups in a short burst, while a fan control loop
does a thermal sensor sweep, takes a decision, and updates the fan control
register.

There is also the annoying issue that you need to clobber the internal fan
loop controller regularly to mess with its recalibration (that causes
annoying pulses in the fan unless you fixed the firmware of your thinkpad),
that also means more wakeups and ACPI EC activity.

But you really should be able to leave the firmware alone at least 50% of
the time (pester it now, and you don't need to do anything with it for the
next second).

So, if the applications/scripts are reading the thermal sensors more than
once every 2s, THAT is something you can fix.  It is useless to read them
any faster than 0.5Hz.

One day I will feel bored enough to write a cache layer for thinkpad-acpi.
But until then, your scripts better be well behaved, for thinkpad-acpi will
do exactly what you ask it to, no matter how wasteful of resources it is.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh