load average ~1 on powermac

Johannes Berg johannes at sipsolutions.net
Fri Dec 15 01:27:58 EST 2006


Hi,

After investigating a bit I finally found why the load average stays
around 1 on powermacs... Try this:

  watch --interval 0.1 "ps xa|grep ' D'"

it'll show [kwindfarm] most of the time, with it going away for a while
sometimes.

Now, I thought windfarm wasn't actually doing anything wrong, it's doing
interruptible sleep. Not so!

@@ -115,11 +113,12 @@ static int wf_thread_func(void *data)
                }

                delay = next - jiffies;
+               printk(KERN_DEBUG "delay = %lu\n", delay);
                if (delay <= HZ)
                        schedule_timeout_interruptible(delay);

reveals that in fact it's only sleeping for about 300 milliseconds most
of the time!

Now doing sysrq t a lot of time reveals that it's spending the rest in
wait_for_completion, called from two places.

* windfarm_smu_controls.c: smu_set_fan
* low_i2c.c: smu_i2c_xfer

the latter is called twice for every windfarm tick and takes about 170
milliseconds for each call, the first I haven't measured but it pretty
much has to account for the rest of the second...

I don't quite understand why the fan speed has to be set every tick but
even just reading the i2c stuff is probably bad enough.

I don't think we can solve this easily since all these things may be
called from userspace processes so being interruptible is not
appropriate unless we want to somehow handle that, but that probably
won't be easy.

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20061214/ebf273e6/attachment.pgp>


More information about the Linuxppc-dev mailing list