Re: cross-cpu balancing with the new scheduler

Rusty Russell (rusty@rustcorp.com.au)
Mon, 14 Jan 2002 15:37:27 +1100


In message <Pine.LNX.4.40.0201131842570.937-100000@blue1.dev.mcafeelabs.com> yo
u write:
> On Mon, 14 Jan 2002, Rusty Russell wrote:
>
> > This could be fixed by making "nr_running" closer to a "priority sum".
>
> I've a very simple phrase when QA is bugging me with these corner cases :
>
> "As Designed"

My point is: it's just a heuristic number. It currently reflects the
number on the runqueue, but there's no reason it *has to* (except the
name, of course).

1) The nr_running() function can use rq->active->nr_active +
rq->expired->nr_active. And anyway it's only as "am I
idle?".

2) The test inside schedule() can be replaced by checking the result
of the sched_find_first_zero_bit() (I have a patch which does this
to good effect, but for other reasons).

The other uses of nr_running are all "how long is this runqueue for
rebalancing", and Ingo *already* modifies his use of this number,
using the "prev_nr_running" hack.

Hope that clarifies,
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/