Re: Idle loadavg of ~1, maybe MD related

Andrew Morton
2008-01-06T03:05:17Z

On Sat, 05 Jan 2008 21:18:52 +1100 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Sat, 2008-01-05 at 02:04 -0800, Robin H. Johnson wrote:
> > On Sat, Jan 05, 2008 at 01:30:37AM -0800, Andrew Morton wrote:
> > > >From that I'd suspect that kwindfarm is being a bad citizen.
> > > If a process is consistently stuck in D state, run
> > Windfarm.
>
> It's an unfortunate artifact that kernel threads that do
> non-interruptible sleep are counted as load...
>
> In the case of windfarm, it does a lot (a _LOT_) of accesses to various
> i2c busses and the SMU (the system management unit which controls the
> fans). All those are done in the form of short requests during which the
> process is doing a wait_for_completion() or similar.
>
> I don't see a better way to do that, I think we could have good use of
> something that stops counting those in the load average...

Maybe, but we can usually work around it pretty comfortably.

If smu_set_fan() is only ever called by a kernel thread then we can simply
flip it over to using wait_for_completion_interruptible().

If smu_set_fan() is also called from user processes then things aren't so
easy...