Re: [REPORT] cfs-v4 vs sd-0.44

Ingo Molnar
2007-04-23T19:15:15Z

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> but the point I'm trying to make is that X shouldn't get more CPU-time
> because it's "more important" (it's not: and as noted earlier,
> thinking that it's more important skews the problem and makes for too
> *much* scheduling). X should get more CPU time simply because it
> should get it's "fair CPU share" relative to the *sum* of the clients,
> not relative to any client individually.

yeah. And this is not a pipe dream and i think it does not need a
'wakeup matrix' or other complexities.

I am --->.<---- this close to being able to do this very robustly under
CFS via simple rules of economy and trade: there the p->wait_runtime
metric is intentionally a "physical resource" of "hard-earned right to
execute on the CPU, by having waited on it" the sum of which is bound
for the whole system.

So while with other, heuristic approaches we always had the problem of
creating a "hyper-inflation" of an uneconomic virtual currency that
could be freely printed by certain tasks, in CFS the economy of this is
strict and the finegrained plus/minus balance is strictly managed by a
conservative and independent central bank.

So we can actually let tasks "trade" in these very physical units of
"right to execute on the CPU". A task giving it to another task means
that this task _already gave up CPU time in the past_. So it's the
robust equivalent of an economy's "money earned" concept, and this
"money"'s distribution (and redistribution) is totally fair and totally
balanced and is not prone to "inflation".

The "give scheduler money" transaction can be both an "implicit
transaction" (for example when writing to UNIX domain sockets or
blocking on a pipe, etc.), or it could be an "explicit transaction":
sched_yield_to(). This latter i've already implemented for CFS, but it's
much less useful than the really significant implicit ones, the ones
which will help X.

Ingo