[ltp] fancontrol script causes hundreds of wakeups per second

Tino Keitel linux-thinkpad@linux-thinkpad.org
Wed, 2 Jul 2008 07:52:31 +0200


On Tue, Jul 01, 2008 at 20:16:58 -0300, Henrique de Moraes Holschuh wrote:

[...]

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

The fancontrol script reads wakes up every 3 seconds. However, it reads
from /proc/acpi/ibm/fan, thermal, ecdump, and then writes to fan in
every loop. I think this can be optimized.

I tested with a "while true ; do sensors ; sleep 3 ; done" and powertop
shows 10-12 wakeups per second for acpi. This sensors command reads the
fan and thermal sensors. I don't know why the fancontrol script
requires ecdump when fan and thermal data is available in fan and
thermal. Writing the level in every loop could also be optimized, to
write only if changes are required, which isn't too often. Extending
the sleep between loops from 3 to 10 seconds should give 3-4 wakeups
per second.

Regards,
Tino