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

Jeremy Fitzhardinge
2007-04-23T22:48:43Z

Linus Torvalds wrote:
> The "perfect" situation would be that when somebody goes to sleep, any
> extra points it had could be given to whoever it woke up last. Note that
> for something like X, it means that the points are 100% ephemeral: it gets
> points when a client sends it a request, but it would *lose* the points
> again when it sends the reply!
>
> So it would only accumulate "scheduling points" while multiuple clients
> are actively waiting for it, which actually sounds like exactly the right
> thing. However, I don't really see how to do it well, especially since the
> kernel cannot actually match up the client that gave some scheduling
> points to the reply that X sends back.
>

This works out in quite an interesting way. If the economy is closed -
all clients and servers are managed by the same scheduler - then the
server could get no inherent CPU priority and live entirely on donated
shares. If that were the case, you'd have to make sure that the server
used the donation from client A on client A's work, otherwise you'd get
freeloaders - but maybe it will all work out.

It gets more interesting when you have a non-closed system - the X
server is working on behalf of external clients over TCP. Presumably
wakeups from incoming TCP connections wouldn't have any scheduler shares
associated with it, so the X server would have to use its inherent CPU
allocation to service those requests. Or the external client could
effectively end up freeloading off portions of the local clients' donations.

J